score:2
Accepted answer
Assuming your test.php
will return a single new point on each call, I'd code it like this:
var chart = null;
function callAjax(){
$.getJSON('test.php', function(data) {
if (chart === null){ // first call, create the chart
options.series = data;
chart = new Highcharts.Chart(options);
} else {
var seriesOneNewPoint = data[0].data[0]; // subsequent calls, just get the point and add it
var seriesTwoNewPoint = data[1].data[0];
chart.series[0].addPoint(seriesOneNewPoint, false, false); // first false is don't redraw until both series are updated
chart.series[1].addPoint(seriesTwoNewPoint, true, false); // second false is don't shift
}
setTimeout(callAjax, 20000); // queue up next ajax call
});
}
callAjax();
Here's an example. Note, it just draws the same point over and over again.
Source: stackoverflow.com
Related Query
- highcharts spline with multiple series update every few seconds
- How to update Highcharts with multiple series via JSON?
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts series update with animation
- Dynamic update of multiple series in highcharts
- Highcharts with JSON data and multiple series
- Highcharts: update series on multiple charts with same data
- Multiple Series Timeline with HighCharts
- Highcharts not displaying series data for graph with multiple Y-axes
- Click events on highcharts with multiple series
- Highcharts async Server Loading with multiple series
- Highcharts problem with xAxis using multiple series
- Change chart type and redraw with multiple series in Highcharts
- Highcharts shared tooltip between charts with multiple series and shared tooltip
- Highcharts show the same yAxis start and end value with multiple data series
- Highcharts - How to make a scatter plot with multiple series from HTML table
- Highcharts Multiple series with database
- Highcharts synchronize tooltip on multiple charts with multiple series
- Charts using Highcharts with multiple series from JSON
- Strange behavior with highcharts when using "column" type and multiple datetime series
- Highcharts with multiple series from JSON Dynamically
- Highcharts solid gauge with multiple series
- Highcharts 3.08 drilldown with multiple parent series
- Multiple series in Highcharts with multiple drilldowns
- Highcharts with JSON to customize multiple series
- Highcharts with multiple series from JSON
- Highcharts multiple series combined with linkedTo hover issue
- Highcharts mouse tracking behaviour with multiple arearange & line series
- Highcharts drilldown to pie chart - Clicking on axis label with multiple series causes pie charts to overlap
- I want to update my series dynamically on highcharts with a click & also bring it to the original way by clicking on an other button (#previous)
More Query from same tag
- Disable Plotpoint legend on hover in Highcharts
- Highcharts adding integer instead of date
- Highcharts Renderer Button ID
- Highcharts - multiple charts
- GWT Highcharts tooltip positioning
- Dynamically updating a highcharts object after data refresh in React
- Highcharts SVG accessibility
- Highcharts - How to plot a X axis line on my bell curve (Standard Deviation Curve)
- Highcharts - Funnel, Line and Scatter
- R Shiny - Highcharts: Tooltip delay before display
- Remove Highcharts x-axis label thousands separator
- Highcharts : use function in Serie data
- GWT Highcharts - Semi circle donut
- Problems with Highcharts exporting server: Encoding and quality
- HighChat Heatmap: Tooltip
- highcharts line not fully plotted
- Start x axis at minimum value
- Uncaught TypeError: undefined is not a function when using highcharts
- highstock chart move selection on keybord arrow key press
- Highcharts Polar Stacked Column chart - Legend is cut off
- Highcharts: Plot yAxis values starting from a specific range
- Why is my JSON formatting different from HighCharts examples?
- Highcharts width flow out of parent div
- Highcharts area range series change plotting area dynamically
- Donut Chart : Trigger legend or pie click event while selecting outside filter state change
- Can not access Highcharts chart from container, so I can't change data in a chart dynamically
- Add line to 3d column chart in Highcharts
- Add rectangle to highchart
- Highchart-ng not displaying inside a directive
- High chart Displaying wrong month value in xaxis