JSFiddle - React, Tailwind, and code Playground

by apasaja

HTML

<script src="https://www.google.com/jsapi"></script>
<div class="chartwrapper">
    <!--Div that will hold the bar charts -->
    <div id="number_format_chart"></div>
</div>

CSS

.chartwrapper {
    margin: 20px 0 12px 0;
}
#number_format_chart {
    width: 100%
}

JavaScript

google.load("visualization", "1", {
    packages: [ "corechart", "bar" ]
});

google.setOnLoadCallback(drawVisualization);

function drawVisualization() {
    // Some raw data (not necessarily accurate)
    var data = google.visualization.arrayToDataTable([
        [ 'Month', 'Col1', 'Col2', 'Col3', 'Col4', 'Col5', 'Col6' ],
        [ 'Set 1', 165, 938, 522, 998, 450, 614.6 ],
        [ 'Set 2', 135, 1120, 599, 1268, 288, 682 ],
        [ 'Set 3', 157, 1167, 587, 807, 397, 623 ],
        [ 'Set 4', 139, 1110, 615, 968, 215, 609.4 ],
        [ 'Set 5', 136, 691, 629, 1026, 366, 569.6 ]
    ]);

    var options = {
        title: 'Chart title',
        width: 1001,
        height: 500,
        vAxis: {
            title: "VAxis title"
        },
        hAxis: {
            title: "HAxis title"
        },
        seriesType: "bars",
        series: {
            0: { targetAxisIndex: 0 }, // Bind series 0 to an axis named 'distance'.
            1: { targetAxisIndex: 1 }, // Bind series 1 to an axis named 'brightness'.
            5: {
                type: "line"
            }
        },
        axes: {
            y: {
                0: {
                    label: 'leftyaxis'
                }, // Left y-axis.
                1: {
                    side: 'right',
                    label: 'rightyaxis'
                } // Right y-axis.
            }
}
    };

    var chart = new google.visualization.ComboChart(document.getElementById('number_format_chart'));
    chart.draw(data, options);
}