score:0
Accepted answer
The issue is that you were not defining your chart in:
$("#refresh").click(function() {
var options = chart.options;
chart = new Highcharts.Chart(options);
});
Try defining it before you call the new HighCharts code:
$("#refresh").click(function () {
var chart = $('#container').highcharts();
var options = chart.options;
chart = new Highcharts.Chart(options);
});
See example here.
Also note you have some invalid syntax in the tooltip as well as some dangling commas.
score:2
wergeld is correct.
You may try this fiddle which just updates the series data and refreshes the chart afterwards.
This will not recreate the chart from scratch, but rather only update it.
It's a bit more code, but depending on your usecase this might be useful.
here is the code in question:
$('#container').highcharts({
// [...]
series : [{ id: 'series1' }, { id: 'series2' }]
});
$("#refresh").click(function() {
var complete = function(options) {
// get the two HC-series objects
var chart = $('#container').highcharts();
var series1 = chart.get('series1');
var series2 = chart.get('series2');
// set new data
series1.setData(options.series[0].data, false);
series2.setData(options.series[1].data, false);
// and redraw chart
chart.redraw();
};
// call the data parser of HC
Highcharts.data({
table : document.getElementById('datatable'),
complete : complete
});
});
Source: stackoverflow.com
Related Articles
- Using an editable table with HighChart and having the chart refresh with change
- Adding data to a highchart chart using an array with IDs
- how to dynamically change column chart to mirror chart using highchart
- HighChart Sparkline Chart with dynamic data for the table
- Highcharts display label for pie chart using html table as data source
- R efficient Drilldown chart with loop using Highchart
- How can i draw a high chart with two labels in x coordinate using highchart
- Json to Chart using highchart export server with Node js module its throw error
- Export Table and Chart In PDF In HIGHCHART with ANGULAR
- How to change value of highchart graph with the other value with refresh
- How to create a new Highstock chart with new Highchart and not jquery?
- Highchart Area Range chart with gradient that follows the line
- Change color of bars depending on value in Highchart bar-chart with MVC3
- Create Density Heatmap Chart using Jquery with array of data
- Highcharts with reveal.js: Refresh chart with slide?
- creating a bar chart using Highcharts with React - getting an error that rendering div isn't found
- Highcharts: having trouble recreating stacked area chart from Excel with positive and negative values
- Timeline chart with highcharts using x-range with multiple stacks
- create a donut chart using highchart using jquery json object
- Using Trellis Chart with Stacked Columns in Highcharts
- using angular directive to draw highchart pie chart but when i am using it in success function it is not working
- Link table data with chart data Jquery
- Change chart type and redraw with multiple series in Highcharts
- jQuery Highcharts: change chart type using dropdown list
- Using wkhtmltopdf with highcharts shows blank chart
- Change chart type with drilldown series
- change highchart data using radio buttons
- Error while creating the chart using highchart
- how to change color of line chart in highchart based on a categorical column in r?
- How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page?
- How do I make a fixed range?
- Highcharts: multiple series columns by year
- Highcharts Plotoptions Series
- How to create a column range chart in Highcharts using range and navigator functions?
- Access props and state of current component in React JS within an event handler
- adding increase arrow in highcharts
- Highcharts Scatter plot - Add series from database as a different color
- HighChart Line Graph value from database
- Create Highcharts bubble chart dynamically
- multiple series in Highcharter R stacked barchart
- Change color of pie chart on drilldown
- Is it possible to set the tick interval's pixel width?
- Highstock.js - Adding a point to the chart dynamically to a new series
- Legends display order in piechart highcharts
- Highcharts Dynamic Chart with MySQL Data doesn't reload
- Highcharts: Is it possible to have separate plotOptions for each series?
- Highcharts same scale steps (equal tick interval) on x and y axis
- How can I put text within horizontal bar chart data points using Highcharts as well as adding text underneath each data point? Example below:
- Highcharts fails on load "evaluating Y[fa].pointer"
- Can I add custom data for highcharts RSI indicator?