index.htm 3.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129
  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. #container {
  9. max-width: 800px;
  10. height: 400px;
  11. margin: 1em auto;
  12. }
  13. .highcharts-series-hover path {
  14. stroke: rgb(255, 66, 66);
  15. stroke-width: 2px;
  16. }
  17. </style>
  18. </head>
  19. <body>
  20. <script src="https://code.jquery.com/jquery-3.1.1.min.js"></script>
  21. <script src="../../code/highcharts.js"></script>
  22. <script src="../../code/modules/parallel-coordinates.js"></script>
  23. <div id="container"></div>
  24. <script type="text/javascript">
  25. $.getJSON(
  26. 'https://cdn.rawgit.com/highcharts/highcharts/057b672172ccc6c08fe7dbb27fc17ebca3f5b770/samples/data/marathon.json',
  27. function (data) {
  28. Highcharts.chart('container', {
  29. chart: {
  30. type: 'spline',
  31. parallelCoordinates: true,
  32. parallelAxes: {
  33. lineWidth: 2
  34. }
  35. },
  36. title: {
  37. text: 'Marathon set'
  38. },
  39. plotOptions: {
  40. series: {
  41. animation: false,
  42. marker: {
  43. enabled: false,
  44. states: {
  45. hover: {
  46. enabled: false
  47. }
  48. }
  49. },
  50. states: {
  51. hover: {
  52. halo: {
  53. size: 0
  54. }
  55. }
  56. },
  57. events: {
  58. mouseOver: function () {
  59. this.group.toFront();
  60. }
  61. }
  62. }
  63. },
  64. tooltip: {
  65. pointFormat: '<span style="color:{point.color}">\u25CF</span>' +
  66. '{series.name}: <b>{point.formattedValue}</b><br/>'
  67. },
  68. xAxis: {
  69. categories: [
  70. 'Training date',
  71. 'Miles for training run',
  72. 'Training time',
  73. 'Shoe brand',
  74. 'Running pace per mile',
  75. 'Short or long',
  76. 'After 2004'
  77. ],
  78. offset: 10
  79. },
  80. yAxis: [{
  81. type: 'datetime',
  82. tooltipValueFormat: '{value:%Y-%m-%d}'
  83. }, {
  84. min: 0,
  85. tooltipValueFormat: '{value} mile(s)'
  86. }, {
  87. type: 'datetime',
  88. min: 0,
  89. labels: {
  90. format: '{value:%H:%M}'
  91. }
  92. }, {
  93. categories: [
  94. 'Other',
  95. 'Adidas',
  96. 'Mizuno',
  97. 'Asics',
  98. 'Brooks',
  99. 'New Balance',
  100. 'Izumi'
  101. ]
  102. }, {
  103. type: 'datetime'
  104. }, {
  105. categories: ['&gt; 5miles', '&lt; 5miles']
  106. }, {
  107. categories: ['Before', 'After']
  108. }],
  109. colors: ['rgba(11, 200, 200, 0.1)'],
  110. series: data.map(function (set, i) {
  111. return {
  112. name: 'Runner ' + i,
  113. data: set,
  114. shadow: false
  115. };
  116. })
  117. });
  118. }
  119. );
  120. </script>
  121. </body>
  122. </html>