市长热线演示版

index.htm 9.7KB

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