JSFiddle - React, Tailwind, and code Playground

by hfrntt

HTML

<script type="text/javascript" src="http://highcharts.com/js/testing.js"></script>

<div id="container" style="height: 300px"></div>
<button>data2</button>

JavaScript

var data = data1 = [29.9, 71.5, 106.4, 129.2, 144.0, 176.0],
           data2 = [135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
    options = {
        chart: {
            renderTo: 'container'
        },
        xAxis: {
            categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
        },
        series: [{
            data: data1
        }]
    };

var chart = new Highcharts.Chart(options);

$('button').click(function(){
    options.series[0].data = data2;
    chart = new Highcharts.Chart(options);
});