Highcharts Demo
author(s): Torstein Hønsi
by dacaserna
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/modules/data.js"></script>
<script src="https://code.highcharts.com/modules/drilldown.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
// Create the chart
Highcharts.chart('container', {
chart: {
type: 'column',
zoomType: 'xy'
},
title: {
text: 'Browser market shares. January, 2018'
},
subtitle: {
text: 'Click the columns to view versions. Source: <a href="http://statcounter.com" target="_blank">statcounter.com</a>'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'Total percent market share'
}
},
legend: {
enabled: false
},
plotOptions: {
series: {
borderWidth: 0,
dataLabels: {
enabled: true,
format: '{point.y:.1f}%'
}
}
},
tooltip: {
headerFormat: '<span style="font-size:11px">{series.name}</span><br>',
pointFormat: '<span style="color:{point.color}">{point.name}</span>: <b>{point.y:.2f}%</b> of total<br/>'
},
"series": [
{
"name": "Browsers",
"colorByPoint": true,
"data": [
{
"name": "Chrome",
"y": 62.74,
"drilldown": "Chrome"
},
{
"name": "Firefox",
"y": 10.57,
"drilldown": "Firefox"
},
{
"name": "Internet Explorer",
"y": 7.23,
"drilldown": "Internet Explorer"
},
{
"name": "Safari",
"y": 5.58,
"drilldown": "Safari"
},
{
"name": "Edge",
"y": 4.02,
"drilldown": "Edge"
},
{
"name": "Opera",
"y": 1.92,
"drilldown": "Opera"
},
{
...