JSFiddle - React, Tailwind, and code Playground

by Hoang_Van_Trinh

HTML

<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/series-label.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<script src="https://code.highcharts.com/modules/export-data.js"></script>

<div id="container"></div>

JavaScript

Highcharts.chart('container', {

    title: {
        text: 'Tài chính cá nhân, 2015-2025'
    },

    subtitle: {
        text: 'Từ khi bắt đầu đi làm'
    },

    yAxis: {
        title: {
            text: 'Triệu(VNĐ)'
        }
    },
    legend: {
        layout: 'vertical',
        align: 'right',
        verticalAlign: 'middle'
    },

    plotOptions: {
        series: {
            label: {
                connectorAllowed: false
            },
            pointStart: 2015
        }
    },

    series: [{
        name: 'Kế hoạch',
        data: [-100, -50, 0, 70, 200, 500, 800, 1300, 1500, 1700, 1900]
    }, {
        name: 'Thực tế',
        data: [-200, -50, -70, 75, 100, 400, 500,,, ]
    }],

    responsive: {
        rules: [{
            condition: {
                maxWidth: 500
            },
            chartOptions: {
                legend: {
                    layout: 'horizontal',
                    align: 'center',
                    verticalAlign: 'bottom'
                }
            }
        }]
    }

});