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 Query
- Using an editable table with HighChart and having the chart refresh with change
- HighChart Sparkline Chart with dynamic data for the table
- Using the source version instead of mimified when import lib with reactjs and npm
- Export Table and Chart In PDF In HIGHCHART with ANGULAR
- How to change value of highchart graph with the other value with refresh
- Displaying highchart and using php to get data for the chart from mysql database
- How to create a new Highstock chart with new Highchart and not jquery?
- Highchart Area Range chart with gradient that follows the line
- Using Highcharts and displaying a message over or on the chart when there is no data
- Highcharts: having trouble recreating stacked area chart from Excel with positive and negative values
- put the highchart legend to the bottom of the chart and horizontally centered
- Change chart type and redraw with multiple series in Highcharts
- How to set series-label to false by default and change the color of series label text in highchart
- Adding data to a highchart chart using an array with IDs
- Error while creating the chart using highchart
- How to grab correct highchart number in selectors using Selenium Webdriver with Python with several charts on the page?
- how to dynamically change column chart to mirror chart using highchart
- Highchart not displaying the pie chart with Ajax data
- How do I change the style of the inner part enclosed by the lines(polar) chart created with highcharts?
- How to read and insert correct highchart number in selectors using Selenium Webdriver with Python?
- Using Viewmodel and datepicker with Dotnet Highchart in MVC
- How can I make milestone lines with a GANTT chart using the highcharts library?
- How could you supply multiple series to a line chart in R shiny using highcharter package and without hardcoding the series?
- How to set the highchart and the table horizontally?
- Highchart change the chart type in drilldown
- Highcharts display label for pie chart using html table as data source
- Change the legend in highcharts heatmap to show instead of a color bar, a set of fixed icons with hide and show on click
- finding the value in the series object and displaying in the tooltip of the high chart using angular 4
- sort chart bar by color with the correct value from the text file using HIGHCHART,PHP
- I want to capture the starting and end point of all the series in my multigraph and show it in a table using MeasureX of StockTools in Highstock
More Query from same tag
- Adding highcharts to mapbox popup from CSV?
- Heat Map With Red Color Range For Negative Values And Green Color Range For Positive Values
- Tooltip issue on columnrange highchart
- Set Opacity Pie Chart Highcharts
- Highchart uncaught error - Uncaught TypeError: $(...).highcharts is not a function
- Save series chart type for later use
- Highcharts - How to add background in bar series? And how to print page without lose quality?
- Highcharts title alignment
- Why is HighCharts only writing to one of my dynamic div's?
- Can I with highcharts column stacking on hover not highlighting the whole serie
- Is it possible to center the labels and data points between the ticks in a datetime xAxis for Highcharts?
- Highcharts annotations outside the plot area incorrectly placed
- Highcharts ajax loaded tool tip
- rCharts: Change the individual point colors of a time series plot (Highcharts)
- Highcharts not "graphing" in Firefox or Safari
- Download Highcharts Generated Table into R
- avoid tooltip linking line in a HighCharts scatterplot
- Highcharts height issue - remove white space at the top. See JSFiddle :)
- Is it possible update Highchart data automatically and make animated effect?
- Highcharts - column color different from color in legend
- High charts undefined value on customizing tool tip - Unable to get the ID from array
- How to process csv data (datetime) month, week, day, hour in highstock highcharts
- Highcharts - where to place style and changing style for one wedge in a pie chart
- How to fill the Area between two series with multiples yAxis in HighChart?
- How to get points information when hovering over axis labels in highcharts using custom-events library?
- Highcharts column point positioned in the center
- Highcharts / highstock how to change title of chart in IE?
- How to prevent a React onClick event from being consumed by child
- Accordion not working in Highcharts subtitle
- Highcharts - how can I change font size?