500ef3882e59fac7c39ca60d9025cba89a16a04e.svn-base 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293
  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://cdn.hcharts.cn/jquery/jquery-1.8.3.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="http://cdn.hcharts.cn/highcharts/highcharts.js"></script>
  79. <script src="http://cdn.hcharts.cn/highcharts/highcharts-more.js"></script>
  80. <script src="http://cdn.hcharts.cn/highcharts/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>