index.htm 9.8 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262
  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. var chart = new Highcharts.Chart({
  10. chart: {
  11. renderTo: 'container',
  12. events: {
  13. load: function () {
  14. // Draw the flow chart
  15. var ren = this.renderer,
  16. colors = Highcharts.getOptions().colors,
  17. rightArrow = ['M', 0, 0, 'L', 100, 0, 'L', 95, 5, 'M', 100, 0, 'L', 95, -5],
  18. leftArrow = ['M', 100, 0, 'L', 0, 0, 'L', 5, 5, 'M', 0, 0, 'L', 5, -5];
  19. // Separator, client from service
  20. ren.path(['M', 120, 40, 'L', 120, 330])
  21. .attr({
  22. 'stroke-width': 2,
  23. stroke: 'silver',
  24. dashstyle: 'dash'
  25. })
  26. .add();
  27. // Separator, CLI from service
  28. ren.path(['M', 420, 40, 'L', 420, 330])
  29. .attr({
  30. 'stroke-width': 2,
  31. stroke: 'silver',
  32. dashstyle: 'dash'
  33. })
  34. .add();
  35. // Headers
  36. ren.label('Web client', 20, 40)
  37. .css({
  38. fontWeight: 'bold'
  39. })
  40. .add();
  41. ren.label('Web service / CLI', 220, 40)
  42. .css({
  43. fontWeight: 'bold'
  44. })
  45. .add();
  46. ren.label('Command line client', 440, 40)
  47. .css({
  48. fontWeight: 'bold'
  49. })
  50. .add();
  51. // SaaS client label
  52. ren.label('SaaS client<br/>(browser or<br/>script)', 10, 82)
  53. .attr({
  54. fill: colors[0],
  55. stroke: 'white',
  56. 'stroke-width': 2,
  57. padding: 5,
  58. r: 5
  59. })
  60. .css({
  61. color: 'white'
  62. })
  63. .add()
  64. .shadow(true);
  65. // Arrow from SaaS client to Phantom JS
  66. ren.path(rightArrow)
  67. .attr({
  68. 'stroke-width': 2,
  69. stroke: colors[3]
  70. })
  71. .translate(95, 95)
  72. .add();
  73. ren.label('POST options in JSON', 90, 75)
  74. .css({
  75. fontSize: '10px',
  76. color: colors[3]
  77. })
  78. .add();
  79. ren.label('PhantomJS', 210, 82)
  80. .attr({
  81. r: 5,
  82. width: 100,
  83. fill: colors[1]
  84. })
  85. .css({
  86. color: 'white',
  87. fontWeight: 'bold'
  88. })
  89. .add();
  90. // Arrow from Phantom JS to Batik
  91. ren.path(['M', 250, 110, 'L', 250, 185, 'L', 245, 180, 'M', 250, 185, 'L', 255, 180])
  92. .attr({
  93. 'stroke-width': 2,
  94. stroke: colors[3]
  95. })
  96. .add();
  97. ren.label('SVG', 255, 120)
  98. .css({
  99. color: colors[3],
  100. fontSize: '10px'
  101. })
  102. .add();
  103. ren.label('Batik', 210, 200)
  104. .attr({
  105. r: 5,
  106. width: 100,
  107. fill: colors[1]
  108. })
  109. .css({
  110. color: 'white',
  111. fontWeight: 'bold'
  112. })
  113. .add();
  114. // Arrow from Batik to SaaS client
  115. ren.path(['M', 235, 185, 'L', 235, 155, 'C', 235, 130, 235, 130, 215, 130,
  116. 'L', 95, 130, 'L', 100, 125, 'M', 95, 130, 'L', 100, 135])
  117. .attr({
  118. 'stroke-width': 2,
  119. stroke: colors[3]
  120. })
  121. .add();
  122. ren.label('Rasterized image', 100, 110)
  123. .css({
  124. color: colors[3],
  125. fontSize: '10px'
  126. })
  127. .add();
  128. // Browser label
  129. ren.label('Browser<br/>running<br/>Highcharts', 10, 180)
  130. .attr({
  131. fill: colors[0],
  132. stroke: 'white',
  133. 'stroke-width': 2,
  134. padding: 5,
  135. r: 5
  136. })
  137. .css({
  138. color: 'white',
  139. width: '100px'
  140. })
  141. .add()
  142. .shadow(true);
  143. // Arrow from Browser to Batik
  144. ren.path(rightArrow)
  145. .attr({
  146. 'stroke-width': 2,
  147. stroke: colors[1]
  148. })
  149. .translate(95, 205)
  150. .add();
  151. ren.label('POST SVG', 110, 185)
  152. .css({
  153. color: colors[1],
  154. fontSize: '10px'
  155. })
  156. .add();
  157. // Arrow from Batik to Browser
  158. ren.path(leftArrow)
  159. .attr({
  160. 'stroke-width': 2,
  161. stroke: colors[1]
  162. })
  163. .translate(95, 215)
  164. .add();
  165. ren.label('Rasterized image', 100, 215)
  166. .css({
  167. color: colors[1],
  168. fontSize: '10px'
  169. })
  170. .add();
  171. // Script label
  172. ren.label('Script', 450, 82)
  173. .attr({
  174. fill: colors[2],
  175. stroke: 'white',
  176. 'stroke-width': 2,
  177. padding: 5,
  178. r: 5
  179. })
  180. .css({
  181. color: 'white',
  182. width: '100px'
  183. })
  184. .add()
  185. .shadow(true);
  186. // Arrow from Script to PhantomJS
  187. ren.path(leftArrow)
  188. .attr({
  189. 'stroke-width': 2,
  190. stroke: colors[2]
  191. })
  192. .translate(330, 90)
  193. .add();
  194. ren.label('Command', 340, 70)
  195. .css({
  196. color: colors[2],
  197. fontSize: '10px'
  198. })
  199. .add();
  200. // Arrow from PhantomJS to Script
  201. ren.path(rightArrow)
  202. .attr({
  203. 'stroke-width': 2,
  204. stroke: colors[2]
  205. })
  206. .translate(330, 100)
  207. .add();
  208. ren.label('Rasterized image', 330, 100)
  209. .css({
  210. color: colors[2],
  211. fontSize: '10px'
  212. })
  213. .add();
  214. }
  215. }
  216. },
  217. title: {
  218. text: 'Highcharts export server overview'
  219. }
  220. });
  221. });
  222. </script>
  223. </head>
  224. <body>
  225. <script src="../../js/highcharts.js"></script>
  226. <script src="../../js/modules/exporting.js"></script>
  227. <div id="container" style="width: 600px; height: 250px; margin: 0 auto"></div>
  228. </body>
  229. </html>