JSFiddle - React, Tailwind, and code Playground

by oakley808

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: 'column'
            },
    
            title: {
                text: 'Total beer consumed'
            },
    
            xAxis: {
                categories: ['IPAs', 'Stouts', 'Belgian', 'Porters', 'Lagers']
            },
    
            yAxis: {
                allowDecimals: false,
                min: 0,
                title: {
                    text: 'Pints'
                }
            },
    
            tooltip: {
                formatter: function() {
                    return '<b>'+ this.x +'</b><br/>'+
                        this.series.name +': '+ this.y +'<br/>'+
                        'Total: '+ this.point.stackTotal;
                }
            },
    
            plotOptions: {
                column: {
                    stacking: 'normal'
                }
            },
    
            series: [{
                name: 'Michael',
                data: [5, 3, 4, 7, 0],
                stack: 'stud'
            }, {
                name: 'Amy',
                data: [13, 4, 11, 2, 0],
                stack: 'bad ass'
            }]
        });
    });
    
});