index.htm 2.0 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
  5. <meta name="viewport" content="width=device-width, initial-scale=1">
  6. <title>Highcharts Example</title>
  7. <style type="text/css">
  8. </style>
  9. </head>
  10. <body>
  11. <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  12. <script src="../../code/highcharts.js"></script>
  13. <script src="../../code/highcharts-more.js"></script>
  14. <script src="../../code/modules/exporting.js"></script>
  15. <div id="container" style="min-width: 310px; max-width: 600px; height: 400px; margin: 0 auto"></div>
  16. <script type="text/javascript">
  17. Highcharts.chart('container', {
  18. chart: {
  19. type: 'waterfall'
  20. },
  21. title: {
  22. text: 'Highcharts Waterfall'
  23. },
  24. xAxis: {
  25. type: 'category'
  26. },
  27. yAxis: {
  28. title: {
  29. text: 'USD'
  30. }
  31. },
  32. legend: {
  33. enabled: false
  34. },
  35. tooltip: {
  36. pointFormat: '<b>${point.y:,.2f}</b> USD'
  37. },
  38. series: [{
  39. upColor: Highcharts.getOptions().colors[2],
  40. color: Highcharts.getOptions().colors[3],
  41. data: [{
  42. name: 'Start',
  43. y: 120000
  44. }, {
  45. name: 'Product Revenue',
  46. y: 569000
  47. }, {
  48. name: 'Service Revenue',
  49. y: 231000
  50. }, {
  51. name: 'Positive Balance',
  52. isIntermediateSum: true,
  53. color: Highcharts.getOptions().colors[1]
  54. }, {
  55. name: 'Fixed Costs',
  56. y: -342000
  57. }, {
  58. name: 'Variable Costs',
  59. y: -233000
  60. }, {
  61. name: 'Balance',
  62. isSum: true,
  63. color: Highcharts.getOptions().colors[1]
  64. }],
  65. dataLabels: {
  66. enabled: true,
  67. formatter: function () {
  68. return Highcharts.numberFormat(this.y / 1000, 0, ',') + 'k';
  69. },
  70. style: {
  71. fontWeight: 'bold'
  72. }
  73. },
  74. pointPadding: 0
  75. }]
  76. });
  77. </script>
  78. </body>
  79. </html>