score:1
Accepted answer
Use setData
method:
var data = [{
"data": [70]
},
{
"data": [-30]
}
]
var chart = Highcharts.chart('container', {
series: [{
color: 'red',
data: []
}, {
color: 'blue',
data: []
}]
});
document.getElementById("data").addEventListener('click', function() {
data.forEach(function(el, i) {
chart.series[i].setData(el.data);
});
});
Live demo: http://jsfiddle.net/BlackLabel/z5aLvgxq/
API: https://api.highcharts.com/class-reference/Highcharts.Series#setData
Source: stackoverflow.com
Related Query
- How to update just data attribute under series in highcharts with json?
- How to have multiple highcharts with different series data in vuejs without repeating code
- Highcharts with JSON data and multiple series
- How to construct HighCharts data series to match returned Json via ajax call
- How to update Highcharts with multiple series via JSON?
- How update in real time with highcharts 3 data module?
- Extract data series from a JSON array for a Highcharts chart with 2 y-axis
- Highcharts series visibility with csv data source
- How to redraw highchart series with json data value?
- Loading json data to highcharts with multiple series
- Highcharts How to update all series with ajax
- How to pass JSON data to update Highcharts Pie chart
- how to draw charts with json file data in highcharts
- In Highcharts How to keep rectangle such SVG elements attached with series data but not with pixel when resize,reflow,redraw,zooming in out?
- How to make multiple Y-axis with incoming series of data from database using Highcharts
- Highcharts pie/bar combo. How to load json and how are the data series expressed
- Highcharts displays series names but missing data points from json source
- How to retrieve/display title, units, copyright along with JSON data in Highcharts
- Reload chart data via JSON with Highcharts
- Highcharts doesn't display series with lots of data points
- Highcharts data series issue with ajax/json and PHP
- How to export the whole page or html content with Highcharts not just the chart?
- How To Use Epoch Time With Highcharts Series Data?
- Highcharts series update with animation
- How to pass json data to highcharts series?
- Highcharts how to use JavaScript variable as series data source?
- How to get multiple data series into Highcharts
- How to structure Angular with Highcharts and lots of dynamic data
- Highcharts: update series on multiple charts with same data
- How to hide one series data info in tooltip using highcharts
More Query from same tag
- Highcharts-ng reset zoom
- Export Highchart + HTML as Image in angularjs app
- Use HTML class as Highcharts table data source
- how to place the chart in the centre while using django-chartit?
- Return the next line of a csv file each time a php script is called
- how to display chart in jquery?
- How can I replace the last datapoint in HighStock/HighCharts?
- Highcharts backgroundColor for multiple charts is only applied to one chart
- get serieName and category value using highcharts
- Use image in Highcharts credits
- Add label in into square Highcharts Gant
- Change the series title in a Highcharts drill down legend
- Highcharts - nested sliced donut charts
- Plotting using highcharts.js labels are being rendered off-center in stead of being centered
- highcharts dynamically adding series with addSeries
- how to remove black color from circle?
- Highstock crashing chrome?
- Highcharts line not plotting
- how to change my pie chart color according to the value
- Highcharts Y-Axis Limits
- Unable to show all the words on Highcharts wordcloud
- Vue 3 - Dynamic require of "highcharts" is not supported
- Making a dataLabel draggable
- How to create india map chart using Hightcharts?
- Would it be possible to make sure that when a cursor hovers over a certain area, it would not change to "hand"?
- Angular-Highcharts: Cannot read property of 'Apartment' of undefined of an object
- In highchart, after giving unequal tickPositions how to keep grid lines position equal?
- Change a highchart x axis Label
- Onclick download the highchart
- Integrating Highcharts into Angular-gridster