I use highchart js to visualize my data, category is an array of timestamp (in milliseconds), it works well, however I need to make it real-time, updated every 20 seconds.
I tried to use addPoint function provided by highchart to add new point into current chart, I got an error www.highcharts.com/errors/19, it said that
Too many ticks
This error happens when you try to apply too many ticks to an axis, specifically when you add more ticks than the axis pixel length. In practice, it doesn't make sense to add ticks so densely that they can't be distinguished from each other. One cause of the error may be that you set a tickInterval that is too small for the data value range. In general, tickPixelInterval is a better option, as it will handle this automatically. Another case is if you try to set categories on a datetime axis, which will result in Highcharts trying to add one tick on every millisecond since 1970.
This is my fiddle http://jsfiddle.net/ndkhoiits/5jh93/
chart: {
type: 'area',
events: {
click: function () {
var series1 = this.series[0];
var series2 = this.series[1];
// Add more 20 seconds
var x = series1.points[series1.points.length - 1].category + 20 * 1000;
//error here
series1.addPoint([x, 1000], true, true);
}
}
},
Please help to check how can I add new point into chart, moreover I think we should use type is datetime for xAxis but I don't know how to use, if you can please give me the solution.