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.

90 lines
3.1 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: 'area'
  15. },
  16. title: {
  17. text: 'US and USSR nuclear stockpiles'
  18. },
  19. subtitle: {
  20. text: 'Source: <a href="http://thebulletin.metapress.com/content/c4120650912x74k7/fulltext.pdf">' +
  21. 'thebulletin.metapress.com</a>'
  22. },
  23. xAxis: {
  24. allowDecimals: false,
  25. labels: {
  26. formatter: function () {
  27. return this.value; // clean, unformatted number for year
  28. }
  29. }
  30. },
  31. yAxis: {
  32. title: {
  33. text: 'Nuclear weapon states'
  34. },
  35. labels: {
  36. formatter: function () {
  37. return this.value / 1000 + 'k';
  38. }
  39. }
  40. },
  41. tooltip: {
  42. pointFormat: '{series.name} produced <b>{point.y:,.0f}</b><br/>warheads in {point.x}'
  43. },
  44. plotOptions: {
  45. area: {
  46. pointStart: 1940,
  47. marker: {
  48. enabled: false,
  49. symbol: 'circle',
  50. radius: 2,
  51. states: {
  52. hover: {
  53. enabled: true
  54. }
  55. }
  56. }
  57. }
  58. },
  59. series: [{
  60. name: 'USA',
  61. data: [null, null, null, null, null, 6, 11, 32, 110, 235, 369, 640,
  62. 1005, 1436, 2063, 3057, 4618, 6444, 9822, 15468, 20434, 24126,
  63. 27387, 29459, 31056, 31982, 32040, 31233, 29224, 27342, 26662,
  64. 26956, 27912, 28999, 28965, 27826, 25579, 25722, 24826, 24605,
  65. 24304, 23464, 23708, 24099, 24357, 24237, 24401, 24344, 23586,
  66. 22380, 21004, 17287, 14747, 13076, 12555, 12144, 11009, 10950,
  67. 10871, 10824, 10577, 10527, 10475, 10421, 10358, 10295, 10104]
  68. }, {
  69. name: 'USSR/Russia',
  70. data: [null, null, null, null, null, null, null, null, null, null,
  71. 5, 25, 50, 120, 150, 200, 426, 660, 869, 1060, 1605, 2471, 3322,
  72. 4238, 5221, 6129, 7089, 8339, 9399, 10538, 11643, 13092, 14478,
  73. 15915, 17385, 19055, 21205, 23044, 25393, 27935, 30062, 32049,
  74. 33952, 35804, 37431, 39197, 45000, 43000, 41000, 39000, 37000,
  75. 35000, 33000, 31000, 29000, 27000, 25000, 24000, 23000, 22000,
  76. 21000, 20000, 19000, 18000, 18000, 17000, 16000]
  77. }]
  78. });
  79. });
  80. </script>
  81. </head>
  82. <body>
  83. <script src="../../js/highcharts.js"></script>
  84. <script src="../../js/modules/exporting.js"></script>
  85. <div id="container" style="min-width: 310px; height: 400px; margin: 0 auto"></div>
  86. </body>
  87. </html>