JSFiddle - React, Tailwind, and code Playground
HTML
<script src="http://code.highcharts.com/stock/highstock.js"></script>
<script src="http://code.highcharts.com/stock/modules/exporting.js"></script>
<script src="//rawgithub.com/phpepe/highcharts-regression/master/highcharts-regression.js"> </script>
<script src="//rawgithub.com/highcharts/export-csv/master/export-csv.js"></script>
<div id="container" style="height: 400px; min-width: 310px"></div>
JavaScript
$(function() {
Highcharts.setOptions({
lang: {
downloadCSV: 'Download CSV',
downloadXLS: 'Download XLS',
viewData: 'View data table'
}
});
$.getJSON('http://www.highcharts.com/samples/data/jsonp.php?filename=aapl-c.json&callback=?', function(data) {
// Create the chart
$('#container').highcharts('StockChart', {
rangeSelector : {
selected : 1,
inputEnabled: $('#container').width() > 480
},
title : {
text : 'AAPL Stock Price'
},
series : [{
name : 'AAPL',
type: 'scatter',
pointWith: 1,
data : data,
tooltip: {
valueDecimals: 2
},
regression: true ,
regressionSettings: {
name: "loess test",
type: 'loess',
color: '#1111cc',
loessSmooth: 50
},
}]
});
});
});