Highcharts Demo
author(s): Torstein Hønsi
by vibhuti
HTML
<script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="container"></div>
<button id="plain">Plain</button>
<button id="inverted">Inverted</button>
<button id="polar">Polar</button>
CSS
#container {
min-width: 320px;
max-width: 600px;
margin: 0 auto;
}
JavaScript
var chart = Highcharts.chart('container', {
title: {
text: 'Chart.update'
},
subtitle: {
text: 'Plain'
},
xAxis: {
categories: ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']
},
series: [{
type: 'spline',
//colorByPoint: true,
data: [29.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.6, 54.4],
name: 'Expect Roll-over Cargo',
},
{
type: 'spline',
name: 'Priority Demand 3',
data: [33, 2.67, 33, 6.33, 3.33, 533, 2, 36, 3, 2, 1, 2],
marker: {
enabled: false
},
color: '#EFCE5C',
visible: true
},
{
name: 'MLNG 1,2,3 Supply',
data: [33, 32, 33, 23, 31, 1, 3, 33, 32, 2, 33, 1],
color: "#1C2C73",
visible: true
}, {
type: 'spline',
name: 'Priority Demand',
data: [3, 2.67, 3, 6.33, 3.33, 5, 2, 6, 3, 2, 1, 2],
marker: {
enabled: false
},
color: '#EFCE5C',
visible: true
}]
});
$('#plain').click(function () {
chart.update({
series: [{
name: 'Expect Roll-over Cargo',
visible: false}]
});
});
$('#inverted').click(function () {
chart.update({
series: [{
name: 'Expect Roll-over Cargo',
visible: true},
{
name: 'Priorit Demand',
visible: false }]
});
});
$('#polar').click(function () {
chart.update({
series: [{
name: 'Expect Roll-over Cargo',
visible: false},
...