You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

93 lines
2.3 KiB

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