You cannot select more than 25 topics
Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
94 lines
2.1 KiB
HTML
94 lines
2.1 KiB
HTML
2 months ago
|
<!DOCTYPE HTML>
|
||
|
<html>
|
||
|
<head>
|
||
|
<meta http-equiv="Content-Type" content="text/html; charset=utf-8">
|
||
|
<title>Highcharts Example</title>
|
||
|
|
||
|
<script type="text/javascript" src="https://cdn.hcharts.cn/jquery/jquery-1.8.3.min.js"></script>
|
||
|
<style type="text/css">
|
||
|
${demo.css}
|
||
|
</style>
|
||
|
</head>
|
||
|
<body>
|
||
|
|
||
|
<script src="https://cdn.hcharts.cn/highcharts/5.0.9/highcharts.js"></script>
|
||
|
<script src="https://cdn.hcharts.cn/highcharts/5.0.9/highcharts-more.js"></script>
|
||
|
<script src="https://cdn.hcharts.cn/highcharts/5.0.9/modules/exporting.js"></script>
|
||
|
|
||
|
<div id="container" style="min-width: 310px; max-width: 600px; height: 400px; margin: 0 auto"></div>
|
||
|
|
||
|
|
||
|
|
||
|
<script type="text/javascript">
|
||
|
|
||
|
Highcharts.chart('container', {
|
||
|
chart: {
|
||
|
type: 'waterfall'
|
||
|
},
|
||
|
|
||
|
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: 120000
|
||
|
}, {
|
||
|
name: 'Product Revenue',
|
||
|
y: 569000
|
||
|
}, {
|
||
|
name: 'Service Revenue',
|
||
|
y: 231000
|
||
|
}, {
|
||
|
name: 'Positive Balance',
|
||
|
isIntermediateSum: true,
|
||
|
color: Highcharts.getOptions().colors[1]
|
||
|
}, {
|
||
|
name: 'Fixed Costs',
|
||
|
y: -342000
|
||
|
}, {
|
||
|
name: 'Variable Costs',
|
||
|
y: -233000
|
||
|
}, {
|
||
|
name: 'Balance',
|
||
|
isSum: true,
|
||
|
color: Highcharts.getOptions().colors[1]
|
||
|
}],
|
||
|
dataLabels: {
|
||
|
enabled: true,
|
||
|
formatter: function () {
|
||
|
return Highcharts.numberFormat(this.y / 1000, 0, ',') + 'k';
|
||
|
},
|
||
|
style: {
|
||
|
fontWeight: 'bold'
|
||
|
}
|
||
|
},
|
||
|
pointPadding: 0
|
||
|
}]
|
||
|
});
|
||
|
|
||
|
</script>
|
||
|
</body>
|
||
|
</html>
|