Reputation: 3919
Please take a look at my code in JSFiddle;
const chart = { title: { text: "" }, exporting: { enabled: false }, series: [], xAxis: [ { min: 0, max: 10, legend: { enabled: true } } ],
yAxis: [] };
const yAxis = { id: 0, title: { text: "test" }, min: 1, max: 100 }
chart.yAxis.push( yAxis );
const series = { type: "line", id: 0, data: [], name: "test" }
chart.series.push( series );
Highcharts.stockChart( 'container', chart );
Check console for seeing error.
The problem is in setting "min" and "max" of xAxis. If I remove those two properties, it works fine. Could someone tell me what the problem is. I need to have min and max for my chart.
Upvotes: 0
Views: 18
Reputation: 39069
The id
property should be unique and should be a string:
const yAxis = {
id: '0',
...
}
Live demo: https://jsfiddle.net/BlackLabel/op4hudwf/
API Reference: https://api.highcharts.com/highstock/xAxis.id
Upvotes: 1