I am trying to set max value dynamically of the largest number. I am not sure, where I am doing wrong...
Any help please?
Expected:
What I am getting:
PS: I want to find max value (Eg: 100 in this example) and show that as first yAxisLabel and next values should be minus (-) 20 etc...
Chart 1 values [39, 35, 19, 38, 39, 48, 56, 57]
Chart 2 values [39, 35, 19, 38, 39, 48, 56, 57]
Tried options without luck:
yAxis: {
min: 0,
max: 100,
tickInterval: 20,
},
and
yAxis: {
tickInterval: 20,
tickPositioner: function(min,max){
var act = min,
ticks = [];
console.log(this);
while(act <= max){
ticks.push(act);
act+= this.tickInterval;
}
return ticks;
},
min: 0,
max: 100,
},
Thanks to @Kacper Madej who has given below code which resulted
It is possible to use
tockPositioner
and set ticks there like:Example: http://jsfiddle.net/e6har510/