JSFiddle - React, Tailwind, and code Playground

by Joanna Sobańska

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="height: 400px; margin: auto; min-width: 310px; max-width: 600px"></div>

JavaScript

$(function () {
    $('#container').highcharts({

        chart: {
            type: 'boxplot'
        },

        title: {
            text: 'Time of waiting in Ports'
        },

        legend: {
            enabled: false
        },

        xAxis: {
            categories: ['Bahia', 'Paranagua', 'Santos', 'Tubarao', 'Barcarena'],
            title: {
                text: 'Ports.'
            }
        },

        yAxis: {
        		min: 0,
            title: {
                text: 'Time of waiting'
            },
            plotLines: [{
                value: 10,
                color: 'red',
                width: 1,
                label: {
                    text: 'Theoretical mean: 10',
                    align: 'left',
                    style: {
                        color: 'gray'
                    }
                }
            }]
        },

        series: [{
            name: 'Observations',
            data: [
                [3, 4, 7, 8, 10],
                [5, 14, 17, 18, 31],
               	[13, 20, 22, 24, 29],
                [4, 17, 18, 21, 30],
                [1, 4, 7, 12, 22],
            ],
            tooltip: {
                headerFormat: '<em>Experiment No {point.key}</em><br/>'
            }
        }]

    });
});