JSFiddle - React, Tailwind, and code Playground

by mlmason

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>

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

JavaScript

$(function () {

    $('#container').highcharts({
        title: {
            text: 'Height vs Weight'
        },
        subtitle: {
            text: 'Polygon series in Highcharts'
        },
        xAxis: {
            gridLineWidth: 1,
            title: {
                enabled: true,
                text: 'Height (cm)'
            },
            startOnTick: true,
            endOnTick: true,
            showLastLabel: true
        },
        yAxis: {
            title: {
                text: 'Weight (kg)'
            }
        },
    
        series: [ {
            name: 'Observations',
            type: 'scatter',
            color: Highcharts.getOptions().colors[2],
            data: [[161.2, 51.6], [167.5, 59.0], [159.5, 49.2], [157.0, 63.0], [155.8, 53.6]],
            name: 'Tacos',
            type: 'scatter',
            color: Highcharts.getOptions().colors[2],
            data:
               [ [170.0, 59.0], [159.1, 47.6], [166.0, 69.8], [176.2, 66.8], [160.2, 75.2]]

        }],
        tooltip: {
            headerFormat: '<b>{series.name}</b><br>',
            pointFormat: '{point.x} cm, {point.y} kg'
        }
    });
});