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.

95 lines
2.4 KiB

8 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: 'boxplot'
  15. },
  16. title: {
  17. text: 'Highcharts Box Plot Example'
  18. },
  19. legend: {
  20. enabled: false
  21. },
  22. xAxis: {
  23. categories: ['1', '2', '3', '4', '5'],
  24. title: {
  25. text: 'Experiment No.'
  26. }
  27. },
  28. yAxis: {
  29. title: {
  30. text: 'Observations'
  31. },
  32. plotLines: [{
  33. value: 932,
  34. color: 'red',
  35. width: 1,
  36. label: {
  37. text: 'Theoretical mean: 932',
  38. align: 'center',
  39. style: {
  40. color: 'gray'
  41. }
  42. }
  43. }]
  44. },
  45. series: [{
  46. name: 'Observations',
  47. data: [
  48. [760, 801, 848, 895, 965],
  49. [733, 853, 939, 980, 1080],
  50. [714, 762, 817, 870, 918],
  51. [724, 802, 806, 871, 950],
  52. [834, 836, 864, 882, 910]
  53. ],
  54. tooltip: {
  55. headerFormat: '<em>Experiment No {point.key}</em><br/>'
  56. }
  57. }, {
  58. name: 'Outlier',
  59. color: Highcharts.getOptions().colors[0],
  60. type: 'scatter',
  61. data: [ // x, y positions where 0 is the first category
  62. [0, 644],
  63. [4, 718],
  64. [4, 951],
  65. [4, 969]
  66. ],
  67. marker: {
  68. fillColor: 'white',
  69. lineWidth: 1,
  70. lineColor: Highcharts.getOptions().colors[0]
  71. },
  72. tooltip: {
  73. pointFormat: 'Observation: {point.y}'
  74. }
  75. }]
  76. });
  77. });
  78. </script>
  79. </head>
  80. <body>
  81. <script src="../../js/highcharts.js"></script>
  82. <script src="../../js/highcharts-more.js"></script>
  83. <script src="../../js/modules/exporting.js"></script>
  84. <div id="container" style="height: 400px; margin: auto; min-width: 310px; max-width: 600px"></div>
  85. </body>
  86. </html>