score:1
Accepted answer
i think your issue is with the following line:
const otherdatasetindex = ctx.datasetindex === 0 ? 1 : 0;
this will always use the first dataset to compare against. there are 6 total datasets and you want compare sets of two. the below code should fix this.
const otherdatasetindex = ctx.datasetindex % 2 === 0 ? ctx.datasetindex + 1 : ctx.datasetindex - 1;
this will compare all even datasets with the odd dataset just after it and all odd data sets with the even dataset coming before it in the array.
Source: stackoverflow.com
Related Query
- ChartJS, make the bars show correct percentage?
- ChartJs bar chart - keep bars left instead of equally spread across the width
- Chartjs 2.7.3: Set Y data at the correct X position axis
- How to make bar chart animation where all bars grow at the same speed?
- Is there a way to make a view run without having to show the view in the browser in laravel?
- ChartJS Horizontal bars barely visible with 50 records on the Y axis
- Always show last tooltip on all datasets, leave the rest to display on hover? ChartJS
- How to show a "total" sum label on the top of stacked bars
- Issue with chartjs linear gradient for the mixed bar chart in ReactJS is not calculated for each individual Bars
- ChartJS - Show values in the center of each bar
- How to show the chartjs bar chart data values labels as text?
- how to show bar value on the top of each bar in chartjs
- Show Count on top of the bar graph - ChartJS
- Bar chart (chart.js) with only 2 points does not show one of the bars
- How to start the chart from specific time and offest hour and then show the data on chart from target datetime in chartjs
- ChartJS - Show percentage base on data on hover (AngularJS)
- ChartJS - Show percentage on hover (AngularJS)
- ChartJS hover/tooltips: selecting the correct points in the datasets based on x-value
- ChartJS vertical bar chart - measure percentage of the data in each column based on a specified max
- Chartjs show seconds on the x axis and volume on the y
- how can I show only 2 numbers on the xAxe in Chartjs having more than two numbers on the chart? (line chart)
- How do I make the Line in ChartJS not exceed the maximum of yAxes
- Chartjs - how to make line position to vertical center and how to display dotted sharp in the backround?
- Chart.js how to make chart only show the most recent data
- chartJS Horizontal Bar - Hide Stacked Bars But Still Show In Tooltip
- Chart js 2.8 - How to make bars grow at the same speed?
- How to use GET method to choose the right table to show ChartJS graph?
- How to sort color segments by value within the 100% stacked bars rather than by value across all the stacked bars in Highcharts or ChartJs
- How to align ChartJS bars to the left?
- How do I make many ChartJS charts on the same page to have the same height and also even column width?
More Query from same tag
- How to add percentage after value data in chart
- Is it possible to reverse the display order of segments in polar chart?
- How to set minimum value to Radar Chart in chart js
- Insert value into a ChartJS with different data label
- How to change position of labels in Doughnut chart?
- ChartJS v2 - Keep tooltip open when user click on a point of a multiple lines chart
- My ChartJS dates don't show up correctly from coinranking API
- Cannot create property 'datasets' on string
- Reactive charts with Meteor : d3charts , Hightcharts , ChartJS , other?
- Display PHP Array in Chart.js tooltip
- PHP render stacked area chart of JSON dataset
- Tooltip backgroundColor depending on chart color ChartJS
- Chartjs: Custom text on y axis at certain level
- Label Color same as backgroundColor - ChartJS
- How to add label on chart.js on each point
- Chart Js invisible horizontal bar
- Chart.js : How to fill the area under the line to a certain point?
- How can I rotate a pie chart in charts.js?
- Chartjs not picking up twig variable for label
- Javascript Chart.js scale fix
- Pass Ajax response array to Chart.js
- Chart.js multiTooltip labels
- How to increase the size of the donut or pie chart and keep the legend next to it in chart JS?
- start y-axis from 0 in ng2-charts
- Hide empty bars in Grouped Stacked Bar Chart - chart.js
- Updating a chart from chart.js in vue
- How to set ChartJS animation speed?
- chart js chart bar chart not showing data from 0
- Chart.js pie chart not showing
- I need to increase data in a bar chart by one with a button click