Highcharts Demo
author(s): Torstein Hønsi
by techunter
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://momentjs.com/downloads/moment.min.js"></script>
<div id="container"></div>
CSS
#container {
min-width: 310px;
max-width: 800px;
height: 400px;
margin: 0 auto
}
JavaScript
let data=
// put date below
[
[168,4],
[167,19],
[166,28],
[165,13],
[164,11],
[163,29],
[162,7],
[161,22],
[160,27],
[159,21],
[158,7],
[157,7],
[156,28],
[155,48],
[154,24],
[153,36],
[152,3],
[151,48],
[150,25],
[149,32],
[148,25],
[147,55],
[146,36],
[145,36],
[144,50],
[143,78],
[142,44],
[141,51],
[140,8],
[139,24],
[138,22],
[137,24],
[136,20],
[135,31],
[134,22],
[133,20],
[132,20],
[131,23],
[130,16],
[129,12],
[128,9],
[127,22],
[126,32],
[125,5],
[124,5],
[123,24],
[122,15],
[121,25],
[120,17],
[119,25],
[118,24],
[117,30],
[116,3],
[115,25],
[114,52],
[113,19],
[112,31],
[111,21],
[110,21],
[109,37],
[108,24],
[107,39],
[106,54],
[105,54],
[104,30],
[103,50],
[102,57],
[101,35],
[100,83],
[99,74],
[98,58],
[97,75],
[96,37],
[95,49],
[94,86],
[93,91],
[92,14],
[91,56],
[90,35],
[89,30],
[88,24],
[87,34],
[86,85],
[85,42],
[84,56],
[83,39],
[82,47],
[81,44],
[80,9],
[79,22],
[78,43],
[77,32],
[76,29],
[75,42],
[74,39],
[73,22],
[72,33],
[71,41],
[70,68],
[69,52],
[68,33],
[67,37],
[66,70],
[65,25],
[64,56],
[63,42],
[62,55],
[61,36],
[60,48],
[59,95],
[58,60],
[57,40],
[56,37],
[55,91],
[54,82],
[53,84],
[52,49],
[51,76],
[50,54],
[49,64],
[48,56],
[47,52],
[46,62],
[45,52],
[44,12],
[43,24],
[42,46],
[41,34],
[40,48],
[39,66],
[38,45],
[37,63],
[36,48],
[35,54],
[34,61],
[33,63],
[32,22],
[31,35],
[30,61],
[29,105],
[28,75],
[27,99],
[26,125],
[25,208],
[24,334],
[23,404],
[22,408],
[21,461],
[20,166],
[19,483],
[18,462],
[17,395],
[16,342],
[15,417],
[14,400],
[13,379],
[12,224],
[11,228],
[10,225],
[9,212],
[8,133],
[7,228]]
/////////////////
;
data = data.map(d => [moment().utc().add(- d[0], 'month').valueOf(), d[1]]);
//console.debug(data);
Highcharts.chart('container', {
title: {
text: 'Revoked dosimeters'
},
xAxis: {
type: 'datetime'
},
yAxis: {
title: {
text: 'Number of revoked dosimeters'
}
},
legend: {
enable: false
},
plotOptions: {
series: {
...