My requirement is to plot a Highchart using X and Y axes. The x-axis shows years and the y-axis shows the corresponding amount in millions.
For the year 1966, I would like see my chart first traverse to 2396, and then to 435, and only then should it go to the next year 1968 which has the value 435 again. Please see my commented line(// y: (2396, 435) which does not work for me. Please help to resolve this using Highchart.
Below is my Code which you can directly copy to https://jsfiddle.net/y0kqsrav/ editor and execute.
Highcharts.chart('container', {
chart: {
type: 'areaspline'
},
title: {
text: 'Historic and Estimated Worldwide Population Growth by Region'
},
subtitle: {
text: 'Source: Wikipedia.org'
},
xAxis: {
categories: ['1964', '1966', '1968', '1970'],
title: {
enabled: false
}
},
yAxis: {
title: {
text: 'Billions'
},
labels: {
formatter: function () {
return this.value / 100;
}
}
},
tooltip: {
split: true,
valueSuffix: ' millions'
},
plotOptions: {
areaspline: {
stacking: 'areaspline',
lineColor: '#666666',
lineWidth: 1,
marker: {
lineWidth: 1,
lineColor: '#666666',
}
}
},
series: [{
name: 'USA',
data: [
{
x: 1964,
y: 2416
},
{
x: 1966,
y: 2396
// y: (2396, 435),
},
{
x: 1968,
y: 435
},
{
x: 1970,
y: 223
}
]
}]
});