Chartjs-Charsjs drawing second dataset at a times 2 factor yet data are correct

0👍

In your yAxes config you set stacked: true this means for the first dataset it takes 0 as the bottom but for your second dataset it takes the first dataset as the bottom. So if the 2 datasets have 10 and 5 as first datapoint the first dataset will draw it at 10 and the second one will draw 5 above it at 15.

To solve this issue you will need to remove stacked: true from your config like so:

yAxes: [{
  ticks: {
    min: 0,
    stepSize: step,
    fontColor: "#300",
    fontSize: 14
  },
  gridLines: {
    color: "#000",
    lineWidth: 2,
    zeroLineColor: "#000",
    zeroLineWidth: 2
  }
}],

Leave a comment