JSFiddle - React, Tailwind, and code Playground
by considerphlebas
HTML
<script src="http://code.highcharts.com/highcharts.js"></script>
<script src="http://code.highcharts.com/modules/exporting.js"></script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
zoomType: 'xy'
},
title: {
text: 'Average value of digits of pi with starting offset 0 to 50'
},
subtitle: {
text: document.ontouchstart === undefined ?
'Click and drag in the plot area to zoom in' :
'Pinch the chart to zoom in'
},
xAxis: {
title: {
enabled: true,
text: 'Position after decimal point'
},
showLastLabel: true
},
yAxis: {
title: {
text: 'Average value of digits to that position'
}
},
legend: {
enabled: true
},
tooltip: {
shared: true,
crosshairs: true
},
plotOptions: {
area: {
fillColor: {
linearGradient: {
x1: 0,
y1: 0,
x2: 0,
y2: 1
},
stops: [
[0, Highcharts.getOptions().colors[0]],
[1, Highcharts.Color(Highcharts.getOptions().colors[0]).setOpacity(0).get('rgba')]
]
},
marker: {
radius: 2
},
lineWidth: 1,
states: {
hover: {
lineWidth: 1
}
},
threshold: null
}
},
series: [ {
type: 'line',
name: 'pi (no offset)',
marker: {
enabled: false
},
data: [1.0, 2.5, 2.0, 2.75, 4.0, 3.6666, 4.0, 4.125, 4.0, 4.1, 4.4545, 4.8333, 5.0, 5.2857, 5.1333, 4.9375, 4.8235, 5.0, 4.9473, 5.0, 4.8571, 4.9090, 4.8695, 4.7916, 4.72, 4.8461, 4.7777,...