Forex demo 1

author(s): Torstein Hønsi

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>
<script src="https://code.highcharts.com/modules/accessibility.js"></script>

<figure class="highcharts-figure">
    <div id="container"></div>
</figure>

CSS

.highcharts-figure, .highcharts-data-table table {
    min-width: 360px; 
    max-width: 800px;
    margin: 1em auto;
}

.highcharts-data-table table {
	font-family: Verdana, sans-serif;
	border-collapse: collapse;
	border: 1px solid #EBEBEB;
	margin: 10px auto;
	text-align: center;
	width: 100%;
	max-width: 500px;
}
.highcharts-data-table caption {
    padding: 1em 0;
    font-size: 1.2em;
    color: #555;
}
.highcharts-data-table th {
	font-weight: 600;
    padding: 0.5em;
}
.highcharts-data-table td, .highcharts-data-table th, .highcharts-data-table caption {
    padding: 0.5em;
}
.highcharts-data-table thead tr, .highcharts-data-table tr:nth-child(even) {
    background: #f8f8f8;
}
.highcharts-data-table tr:hover {
    background: #f1f7ff;
}

JavaScript

Highcharts.chart('container', {

    title: {
        text: 'Tai khoan forex thu nghiem GOLD 1'
    },

    subtitle: {
        text: '0.5 lot theo 5 giá'
    },

    yAxis: {
        title: {
            text: 'Số tiền (K$)'
        }
    },

    xAxis: {
        categories: ['06/03/21', '06/04/21', '06/05/21', '06/06/21', '06/07/21', '06/08/21', '06/09/21', '06/10/21', '06/11/21', '06/12/21', '06/01/22']
    },

    legend: {
        layout: 'vertical',
        align: 'right',
        verticalAlign: 'middle'
    },

    plotOptions: {
            series: {
                pointPadding: 0, // Defaults to 0.1
                groupPadding: 0.2 // Defaults to 0.2
            }
        },
    series: [{
        name: 'So du',
        data: [557, 650, 704, 770, 850, 950, 1100]
    },{
        name: 'Von',
        data: [447, 598, 654, 650, 500, 800, 900]
    }],

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

});