score:1
Accepted answer
I found what seems to be a good solution:
function update(data) {
const s = myChart.series;
for (let i = 0; i < s.length; i++) {
console.log(i);
s[i].setData(data[s[i].name], false); // add "redraw=false" argument
}
myChart.redraw(); // trigger redraw at end of loop
}
Adding false
to the setData
function prevents Highcharts from redrawing after each change. When I get to the end of the loop, I manually trigger a redraw.
This makes the updating much smoother!
score:0
You can just do it like this:
const receivedData = {
'item1': [1, 2, 3],
'item2': [1, 2, 3],
'item3': [1, 2, 3]
};
const update = data => Object.keys(data).map(key => ({ name: key, data: data[key] }));
console.log(update(receivedData));
Source: stackoverflow.com
Related Query
- Highcharts: Update several series at once, for smoother animation
- Highcharts series update with animation
- HighCharts turn animation false for line chart
- Changing data dynamically for a series in Highcharts
- Add additional data to a Highcharts series for use in formatters
- Display tooltip for invisible series in Highcharts
- Highcharts - How to set custom colors for the series
- Dynamic update of multiple series in highcharts
- highcharts - chart names for multiple pie chart series in one chart
- Use an array of objects for series data in Highcharts
- Highcharts Custom tooltips for multiple series
- Highcharts - Provide URL's for series data to open clickable link
- Highcharts shared tooltip for line series and scatter plot not working
- Highcharts-Vue wait for data then update series
- Sort the series data for every X-Axis in Highcharts
- Using PhantomJS to create HighCharts grahps server side for use in PDF creation (PHP) - results in exit code 11 from PHPs exec();
- Highcharts not displaying series data for graph with multiple Y-axes
- How to use add series and update methods in the high chart wrapper for angular?
- Highcharts JS- add third variable to tooltip for two series
- How to show 0 for incomplete Series in Highcharts
- Highcharts - how to update series in angular?
- Highcharts change label text for a single series
- Animation behave differently between initial load and dynamic data series replacement in Highcharts
- how to use object as series for Highcharts
- Highcharts - Aligning dateTime series for shared tooltip
- Changing tooltip shape for a series in Highcharts
- Show special symbol for each series in category in highcharts
- How to display line break for irregular time series with highcharts
- Highcharts Modify Tooltip for One Series
- Highcharts series showing different data for 'column' and 'line' chart
More Query from same tag
- Highchart date quarter view on axis
- React highcharts, show legends as bar
- HighCharts: How to draw a straight line in multiple axes like plotLines with fixed X-axis with different values
- bubble chart with highstock
- how to set border radius for stacked bar in highcharts
- How to show time values in stacked column using High stock
- Treemap in highcharts display series name and value in treemap only
- How to add a newline to a Highchart tooltip?
- Highcharts Line Chart doesn't have connecting lines
- Highcharts Density Dot Map Support?
- How to create column-range chart from data of a HTML table?
- Highcharts with PHP var
- Change Style of Title in HighCharts in ActionResult
- How to add a spikeLine to highchart?
- Show Data For Grouped Series in ToolTip Highcharts
- Plot heatmap from CSV file [Highcharts]
- Highchart stacked area series is not showing correctly
- Highcharts missing information in scatterplot CSV/XLS export
- Pass function to jquery from php
- Bigger chart with highcharts
- Export option not visible in Highcharts
- highstock(highchart) livedata can have move animation point?
- Display User info from Meteor.users, and display with Highcharts
- How to draw an outer border for a donut chart - Highcharts
- Highcharts | Network Graph - Is there a way to expand leaf nodes on click of the Parent node?
- Append data count onto different series
- Highcharts async multi level drill down
- HighCharts – Horizontal chart: moving bars down, make space for labels above them
- Highcharts menus bottom into right side of the graph
- Time setting for hour