JSFiddle - React, Tailwind, and code Playground
by nlem33
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: 400px; height: 400px; margin: 0 auto"></div>
<div id="slidertitle">Units / Month</div>
<div id="slider1"></div>
<div id="slider1_value">0</div>
<div id="slidertitle2">Price / Month</div>
<div id="slider2"></div>
<div id="slider2_value">$0</div>
CSS
#slider1_value{
margin-bottom:40px;
}
JavaScript
$(function () {
var chart;
$(document).ready(function() {
chart = new Highcharts.Chart({
chart: {
renderTo: 'container',
backgroundColor: null,
type: 'area'
},
title: {
text: ''
},
subtitle: {
text: ''
},
xAxis: {
categories: ['1', '2', '3', '4', '5', '6',],
tickmarkPlacement: 'on',
title: {
text: 'months'
}
},
yAxis: {
title: {
text: '$(thousands)'
},
labels: {
formatter: function() {
return this.value / 1000;
}
}
},
tooltip: {
formatter: function() {
return ''+
this.x +': '+ Highcharts.numberFormat(this.y, 0, ',') +' hundred';
}
},
plotOptions: {
area: {
stacking: 'normal',
lineColor: '#666666',
lineWidth: 1,
marker: {
lineWidth: 1,
lineColor: '#666666'
}
}
},
legend:{
align: 'bottom',
x: 275,
borderColor: null
},
credits: {
enabled: false
},
series: [{
name: 'Revenue',
data: [100, 130, 170, 220, 350, 580]
}, {
name: 'Cost',
data: [100, 120, 140, 160, 180, 200]
}]
});
});
});
var min_value = 0;
var max_value = 100;
$('#slider1').slider({
min: min_value,
max: max_value,
step: 5,
slide: function(event, ui)...