Highcharts Demo
author(s):
Torstein Hønsi
HTML
<script src="https://code.highcharts.com/stock/highstock.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
<div class="panel-body">
<table id="data-table" class="table table-striped table-bordered nowrap" width="100%">
<thead>
<tr>
<th>List</th>
<th class="all">Foods</th>
<th class="all">
<input name="select_all" value="1" type="checkbox">
</th>
</tr>
</thead>
<tbody>
<tr class="odd gradeX">
<td>1</td>
<td>Apples</td>
<td>
<input type="checkbox" id="name1" />
</td>
</tr>
<tr class="odd gradeX">
<td>2</td>
<td>Oranges</td>
<td>
<input type="checkbox" id="name2" />
</td>
</tr>
<tr class="odd gradeX">
<td>3</td>
<td>Pears</td>
<td>
<input type="checkbox" id="name3" />
</td>
</tr>
</tbody>
</table>
</div>
JavaScript
Highcharts.stockChart('container', {
alignTicks: false,
rangeSelector: {
selected: 4
},
yAxis: [{ // Primary yAxis
id: 'apple-axis',
tickAmount: 8,
tickInterval: 1,
offset: 26,
labels: {
format: '{value}Apples',
style: {
color: Highcharts.getOptions().colors[2]
}
},
title: {
text: 'Apples',
style: {
color: Highcharts.getOptions().colors[2]
}
},
opposite: true,
min: 0,
max: 100
}, { // Secondary yAxis
id: 'orange-axis',
tickAmount: 8,
gridLineWidth: 0,
title: {
text: 'Oranges',
style: {
color: Highcharts.getOptions().colors[1]
}
},
labels: {
format: '{value} Oranges',
style: {
color: Highcharts.getOptions().colors[1]
}
},
opposite: true,
min: 0,
max: 100
}, { // Tertiary yAxis
id: 'pears-axis',
tickAmount: 8,
tickInterval: 1,
title: {
text: 'Pears',
style: {
color: Highcharts.getOptions().colors[0]
}
},
labels: {
format: '{value} pears',
style: {
color: Highcharts.getOptions().colors[0]
}
},
opposite: true,
min: 0,
max: 25
}],
plotOptions: {
series: {
compare: '',
showInNavigator: true
}
},
tooltip: {
pointFormat: '<span style="color:{series.color}">{series.name}</span>: <b>{point.y}</b> ({point.change}%)<br/>',
valueDecimals: 2,
split: true
},
series: [{
name: 'Apples',
type: 'spline',
yAxis: 0,
data: [
[Date.parse('05/30/2017 13:30:00'), 70],
[Date.parse('05/30/2017 13:45:00'), 70],
[Date.parse('05/30/2017 14:00:00'), 76],
[Date.parse('05/30/2017 14:15:00'), 75],
[Date.parse('05/30/2017 14:30:00'), 78],
[Date.parse('05/30/2017 14:45:00'), 72],
[Date.parse('05/30/2017 15:00:00'), 80],
[Date.parse('05/30/2017 15:15:00'), 73],
[Date.parse('05/30/2017 15:30:00'),...