index.htm 2.4 KB

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