index.htm 8.3 KB

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