JSFiddle - React, Tailwind, and code Playground

by navindian

HTML

<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>


<div id="container" style="height: 500px; min-width: 500px"></div>

JavaScript

$(function() {
    $.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=usdeur.json&callback=?', function(data) {

        // Create the chart
        window.chart = new Highcharts.StockChart({
            chart : {
                renderTo : 'container'
            },

            legend : {
                enabled : true,
            },
            plotOptions : {
                line : {
                    lineWidth : 1
                },
                series : {
                    showCheckbox : true,
                    events : {
                        legendItemClick : function(event) {
                            // window.chart.series[1].visible = false;
                            window.chart.series[1].remove();
                        }
                    }
                }
            },

            series : [{
                name : 'USD to EUR',
                data : data,
                color : 'gray',
                id : 'dataseries'
            },
            // the event marker flags
            {
                type : 'flags',
                data : [{
                    x : "1301046497000"

                }, {
                    x : "1302347794000",

                }],
                onSeries : 'dataseries',
                shape : 'circlepin',
                width : 16
            }]
        });
    });
});