I am facing issue while plotting line chart using chart-js lib.
Here is the codepen : https://codepen.io/bhupendra1011/pen/gObEpJQ, where I set the min Y value as below:
yAxes: [{
ticks: {
min: minY,
maxTicksLimit:5
},
gridLines: {
display:false
}
}]
However if values which are less than minY, then plotted values are not possible , if I remove minY option , then all line graphs are visible, but in my scenario , I want graph to have some initial value.
I also tried using below code instead of setting minY :
afterBuildTicks: function(scale, ticks) {
return [minY].concat(ticks.filter(tick => tick >= minY));
}
although all plotted lines are visible but graph's initial position changes on selecting different series options.Here is the codepen for same: https://codepen.io/bhupendra1011/pen/bGNJNBw
I want chart to start from some initial value , values less than initial values should also be plotted and on updating chart , graph's initial position should not change .
Thanks