I have the following chart with the min set to 0 and the max set to 5. However when I run it the y axis is going from 0 to 6?
If I turn off the endOnTick it gives me a y axis from 0 to 4, with a little space above.
Is there a way to force it to make the ticks work with the min and max, so it would give me ticks ending at 5?
I do not want to manually set the ticks as I do not know exactly what the chart will be sent from our API.
Code: Select all
this.options = {
chart: {
height: 300,
},
title: {
text: ''
},
xAxis: {
title: {
text: 'xAxis'
},
categories: ['Cat A', 'Cat B', 'Cat C', 'Cat D', 'Cat E']
},
yAxis: {
min: 0,
max: 5,
endOnTick: true,
title: {
text: 'yAxis'
}
},
series: [
{
type: 'line',
name: '2020',
data: [4.67, 3.5, 3.75, 3.83, 3.66]
},
{
type: 'line',
name: '2021',
data: [2.5, 3.75, 3.3, 3.69, 3.64]
},
{
type: 'line',
name: '2022',
data: [3.5, 4, 2.55, 2.17, 3.82]
},
{
type: 'line',
name: '2023',
data: [3.67, 4.33, 3.25, 3.79, 4.35]
}
]
};