index.htm 2.3 KB

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