JSFiddle - React, Tailwind, and code Playground
by jeffgw
HTML
<script src="http://code.highcharts.com/highcharts.js"></script><script src="http://code.highcharts.com/modules/exporting.js"></script>
<script src="//rawgithub.com/phpepe/highcharts-regression/master/highcharts-regression.js"> </script>
<div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
$('#container').highcharts({
chart: {
type: 'scatter',
zoomType: 'xy'
},
title: {
text: 'Facility Name'
},
xAxis: {
title: {
enabled: true,
text: 'PTSD Outcomes Score'
},
labels: {
format: '{value}%'
},
startOnTick: true,
endOnTick: true,
showLastLabel: true
},
yAxis: {
title: {
text: 'Cohort Size'
}
},
legend: {
enabled:false
},
plotOptions: {
scatter: {
marker: {
radius: 12,
states: {
hover: {
enabled: true,
lineColor: 'rgb(140, 170, 230)'
}
}
},
states: {
hover: {
marker: {
enabled: false
}
}
},
tooltip: {
headerFormat: '<b>{series.name}</b><br>',
pointFormat: '{point.x}%, {point.y} patients'
}
}
},
series: [{
regression: true ,
regressionSettings: {
type: 'linear',
color: '#414a4c',
lineWidth: 3
},
name: 'Data',
color: 'rgba(100, 152, 191, .5)',
data: [[37.93, 145], [38.41, 138], [38.69, 137], [32.87, 143], [31.91, 141], [30.53,...