JSFiddle - React, Tailwind, and code Playground

by tebrown

HTML

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

<div id="container" style="min-width: 400px; height: 400px; margin: 0 auto"></div>

JavaScript

$(function () {
    var chart;
    $(document).ready(function() {
        chart = new Highcharts.Chart({
            chart: {
                renderTo: 'container',
                type: 'line',
                marginRight: 130,
                marginBottom: 55
            },
            title: {
                text: 'Monthly Average Temperature',
                x: -20 //center
            },
    
            xAxis: {
                categories: ['Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug']
            },
            yAxis: {
                title: {
                    text: 'Temperature (°C)'
                },
                plotLines: [{
                    value: 0,
                    width: 1,
                    color: '#ccc'
                }]
            },
            tooltip: {
                formatter: function() {
                        return '<b>'+ this.series.name +'</b><br/>'+
                        this.x +': '+ this.y +'°C';
                }
            },
            legend: {
                layout: 'vertical',
                align: 'right',
                verticalAlign: 'top',
                x: -10,
                y: 100,
                borderWidth: 0
            },
            series: [{
                name: 'Senior As',
                data: [7.0, 6.9, 2.5, 14.5, 18.2, 21.5]
            }, {
                name: 'Senior Bs',
                data: [-0.2, 0.8, 5.7, 11.3, 17.0, 22.0]
            }, {
                name: 'Colts U21s',
                data: [-0.9, 0.6, 3.5, 8.4, 13.5, 17.0]
            }]
        });
    });
    
});