Olympics athletes by height and weight
by Black Label
HTML
<script src="https://code.highcharts.com/highcharts.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
#container {
max-width: 800px;
margin: auto;
}
.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.setOptions({
colors: ['rgba(5,141,199,0.5)', 'rgba(80,180,50,0.5)', 'rgba(237,86,27,0.5)']
});
const series = [{
"name": "Page Views",
"id": "ABC-page_views",
"data": [
[new Date('2017-01-01T00:00:00Z').getTime(), 1],
[new Date('2017-01-03T00:00:00Z').getTime(), 2],
[new Date('2017-01-04T00:00:00Z').getTime(), 1],
[new Date('2017-01-05T00:00:00Z').getTime(), 2],
[new Date('2017-01-06T00:00:00Z').getTime(), 1],
[new Date('2017-01-07T00:00:00Z').getTime(), 2],
[new Date('2017-01-08T00:00:00Z').getTime(), 1],
]
}]
Highcharts.chart('container', {
chart: {
type: 'scatter',
zoomType: 'xy'
},
xAxis: {
type: 'datetime',
lineColor: "#000",
lineWidth: 3,
labels: {
style: {
color: "#000",
},
},
},
yAxis: {
gridLineColor: "#283347",
lineColor: "#fff",
lineWidth: 3,
labels: {
style: {
color: "#000",
},
},
title: {
text: "",
},
opposite: false,
},
legend: {
enabled: true
},
plotOptions: {
scatter: {
marker: {
radius: 2.5,
symbol: 'circle',
states: {
hover: {
enabled: true,
lineColor: 'rgb(100,100,100)'
}
}
},
states: {
hover: {
marker: {
enabled: false
}
}
},
jitter: {
x: 0.005
}
}
},
tooltip: {
formatter: function() {
return 'Date: ' + Highcharts.dateFormat('%b %d, %Y', new Date(this.x)) + '<br/>PV: ' + this.y;
}
},
series: series
});