JSFiddle - React, Tailwind, and code Playground
by christauff
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<div id="fig1" style="height: 400px"></div>
<p><a href='#' id='get_pettop_total'>Set new data1</a></p>
<p><a href='#' id='get_petcop_total'>Set back data</a></p>
JavaScript
var chart;
var options = {
chart:{
renderTo:'fig1',
type:'line'
},
xAxis: {
type: 'datetime'
},
};
chart = new Highcharts.Chart(options);
function createChart_get_pettop_total(){
get_pettop_total = chart.addSeries({
chart:{
title: '#get_country.countryname# #pettop_seriesLabel# '
},
data:[129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 100.6, 54.4, 29.9, 71.5, 106.4],
name:'pettop_seriesLabel'
},
true);
}
$('#get_pettop_total').click(function() {
createChart_get_pettop_total();
});