JSFiddle - React, Tailwind, and code Playground
by Heena Mahour
HTML
<script src="https://code.highcharts.com/highcharts.js"></script>
<script src="https://code.highcharts.com/highcharts-more.js"></script>
<script src="https://code.highcharts.com/modules/exporting.js"></script>
<div id="line" class="draw">
hi
</div>
<div id="container" class="draw b" style="min-width: 310px; max-width: 600px; height: 400px; margin: 0 auto"></div>
JavaScript
$(function () {
/* var renderer = new Highcharts.Renderer(
$('#container')[0],
400,
300
);
renderer.path(['M', 0, 0, 'L', 100, 100, 200, 50, 300, 100])
.attr({
'stroke-width': 2,
stroke: 'red'
})
.add();*/
$('#container').highcharts({
chart: {
type: 'waterfall'/*,
load: function() {
var ren = this.renderer,
colors = Highcharts.getOptions().colors;
ren.path(['M', 0, 0, 'L', 1000000, 100000000000, 200, 50, 300, 100])
.attr({
'stroke-width': 2,
stroke: 'red'
})
.add();
}*/
},
title: {
text: 'Highcharts Waterfall'
},
xAxis: {
type: 'category'
},
yAxis: {
title: {
text: 'USD'
}
},
legend: {
enabled: false
},
tooltip: {
pointFormat: '<b>${point.y:,.2f}</b> USD'
},
series: [{
upColor: Highcharts.getOptions().colors[2],
color: Highcharts.getOptions().colors[3],
data: [{
name: 'Start',
y: 12
}, {
name: 'Product Revenue',
y: 56
}, {
name: 'Service Revenue',
y: 23
}, {
name: 'Positive Balance',
isIntermediateSum: true,
color: Highcharts.getOptions().colors[1]
}, {
name: 'Fixed Costs',
y: -34
}, {
name: 'Variable Costs',
y: -23
}, {
name: 'Balance',
isSum: true,
color: Highcharts.getOptions().colors[1]
}],
dataLabels: {
enabled: true,
formatter: function () {
...