JSFiddle - React, Tailwind, and code Playground

by Torstein Hønsi

HTML

<link rel="stylesheet" href="http://ajax.googleapis.com/ajax/libs/jqueryui/1.8/themes/base/jquery-ui.css">
<script src="http://code.highcharts.com/rambera/highcharts.js"></script>
<script src="http://code.highcharts.com/rambera/modules/funnel.js"></script>

<div id="resizer" style="min-width: 350px; min-height: 200px; width: 600px">
    <div id="inner-resizer">
        <div id="container" style="height: 400px;">
        </div>
    </div>
</div>

CSS

#resizer {
    border: 1px solid silver;    
}
#inner-resizer { /* make room for the resize handle */
    padding: 10px;
}

JavaScript

$(function () {
    
    Highcharts.getOptions().colors = $.map(Highcharts.getOptions().colors, function (color) {
        return {
            linearGradient: { x1: 0, y1: 0, x2: 1, y2: 0 },
            stops: [
                [0, Highcharts.Color(color).brighten(-0.2).get('rgb')],
                [0.5, color],
                [1, Highcharts.Color(color).brighten(-0.3).get('rgb')]
            ]
        };
    });
    
    
    var chart = new Highcharts.Chart({
        chart: {
            renderTo: 'container',
            type: 'funnel',
            marginLeft: 100
        },
        title: {
            text: 'Sales funnel'
        },
        plotArea: {
            shadow: null,
            borderWidth: null,
            backgroundColor: null
        },
        plotOptions: {
            series: {
                dataLabels: {
                    enabled: true,
                    format: '<b>{point.name}</b> ({point.y:,.0f})',
                    color: 'black',
                    softConnector: true
                },
                neckWidth: '30%',
                neckHeight: '25%'
                
                //-- Other available options
                // height: pixels or percent
                // width: pixels or percent
            }
        },
        legend: {
            enabled: false
        },
        series: [{
            name: 'Browser share',
            data: [
                ['Website visits',   15654],
                ['Downloads',       4064],
                ['Requested price list', 1987],
                ['Invoice sent',    976],
                ['Finalized',    846]
            ]
        }]
    });
    
    // Add the jQuery UI resizin
    var container = $('#container')[0];
    $('#resizer').resizable({
        // On resize, set the chart size to that of the 
        // resizer minus padding. If your chart has a lot of data or other
        // content, the redrawing might be slow. In that case, we recommend 
        //...