score:1
Accepted answer
For this particular use case:
- You can use the update instead of the setData feature.
Demo: https://jsfiddle.net/BlackLabel/1bjfh63c/
Code:
button1.addEventListener('click', function() {
let x = Math.floor(Math.random() * (99)) + 1;
let y = Math.floor(Math.random() * (99)) + 1;
chart1.series[0].setData(
[{
y: x,
name: 'Apple',
color: null,
id: 1,
},
{
y: y,
name: 'Peach',
color: null,
id: 2,
}
], false, false, false);
chart1.redraw();
})
- In setData set the updatePoints flag to false - that's why the error occurred.
demo: https://jsfiddle.net/BlackLabel/umo14be0/
API: https://api.highcharts.com/class-reference/Highcharts.Series#setData
Source: stackoverflow.com
Related Query
- Highcharts pie chart loses color on refresh
- Highcharts --- Change sliced color on drilldown pie chart
- highcharts pie chart color for dynamic data
- Pie chart Slice color Change Dynamically in Highcharts
- Highcharts display label for pie chart using html table as data source
- color sides of 3d pie chart in highcharts
- Highcharts - change color while hovering over a slice in pie chart
- Highcharts - Pie chart Color for each slice
- Highcharts same legend color as of the pie chart slice color
- Highcharts Pie Chart Specify Pie Slice Gradient Color
- Highcharts - change pie slice color on existing chart
- Highcharts same legend color as of the Pie chart slice color?
- Highcharts Pie Chart - slice color dependent of category
- Highcharts PIE chart series color doesn't change
- How to display the value instead of percentage in a pie chart using jquery Highcharts
- HighCharts - Make the pie chart 100% of the div
- Place text in center of pie chart - Highcharts
- Highcharts - labels inside and outside a pie chart
- Highcharts Pie Chart ignores percentageDecimals tooltip setting and has floating point inaccuracy issue
- Highcharts pie chart dynamically changes size
- Highcharts not displaying data labels for Pie chart in arabic
- Total of values in HighCharts Pie Chart
- HighCharts Pie Chart - Add text inside each slice
- highcharts - chart names for multiple pie chart series in one chart
- Highcharts Pie Chart Drilldown not showing on third drill
- Change color of area chart programmatically in highcharts
- Highcharts Pie Chart Label Threshold
- HighCharts - Pie chart drilldown for multilevel (3 to 4 level)
- Grand Totals in HighCharts Pie Chart Legend
- HighCharts Pie Chart Legend value alignment
More Query from same tag
- How do I unbold title of Highcharts' legend?
- How to store the drop value as a new data in my array?
- How to make color bar above navigator in Highstock?
- Having only one yaxis but at the right side on Highcharts.js
- How to draw a line through Y axis 0 value
- Highcharts adding array of variable to series
- Inverted Link chart- Highcharts
- How to build an Organization Chart with highcharter
- How to drilldown a stacked column highchart to show all stacks instead of clicked
- HighCharts - How can i use the period separator in xAxis
- Highstocks individual pane shadow
- Highcharts:Column Range chart having height of bar same as the height of interval in y Axis
- Highcharts tooltip functionality lost from version 2.2.1 to version 3.0.1
- Highcharts Legend Overlaps with X-Axis
- Highcharts X-Axis value on top of stacked column
- stockChart is not defined(…)
- Highcharts - Get container ID from barclick
- Ajax with HighCharts setData on Symfony 2
- How to export Highcharts with CMYK colors?
- A way to generate highcharts dynamically (including web page) in JS?
- rendering react-highcharts with mount enzyme gives an InvalidCharacterError
- Are there better interface to add Highcharts support to Zeppelin
- Manually drilldown highcharts
- Highcharts line chart: point should be clickable, the line between the points not. Is that possible?
- How to query data from database using highcharts in Codeigniter?
- Deleting a record with AJAX in Rails 3
- How to draw arrows on a pie-chart with Highcharts?
- how to change the position of HighCharts.js scatterplot marker position
- Highcharts (scatter) tooltip notworking
- Highchart.getSVG convert to png