vis.js is a dynamic, browser-based visualization library
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.

234 lines
8.3 KiB

  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Graph2d Examples</title>
  8. <!-- Bootstrap -->
  9. <link href="css/bootstrap.min.css" rel="stylesheet">
  10. <!-- HTML5 shim and Respond.js for IE8 support of HTML5 elements and media queries -->
  11. <!-- WARNING: Respond.js doesn't work if you view the page via file:// -->
  12. <!--[if lt IE 9]>
  13. <script src="https://oss.maxcdn.com/html5shiv/3.7.2/html5shiv.min.js"></script>
  14. <script src="https://oss.maxcdn.com/respond/1.4.2/respond.min.js"></script>
  15. <![endif]-->
  16. <link href="./css/prettify.css" rel="stylesheet" type="text/css" />
  17. <script type="text/javascript" src="./js/prettify/prettify.js"></script>
  18. <script src="./dist/vis.js"></script>
  19. <link href="./dist/vis.css" rel="stylesheet" type="text/css" />
  20. <style>
  21. body {
  22. padding:10px;
  23. }
  24. pre {
  25. width:450px;
  26. height:552px;
  27. overflow:auto;
  28. }
  29. #visualization {
  30. display:block;
  31. margin-left:470px;
  32. margin-top:-562px;
  33. width:500px;
  34. height:552px;
  35. border: 1px solid #dddddd;
  36. border-radius:4px;
  37. background-color:#fcfcfc;
  38. }
  39. div.textHTMLContent {
  40. margin-top:10px;
  41. margin-bottom:10px;
  42. display:block;
  43. width:800px;
  44. }
  45. img {
  46. border:1px solid #032740;
  47. width:250px;
  48. height:250px;
  49. margin-top:10px;
  50. }
  51. div.exampleTitle {
  52. width:250px;
  53. height:30px;
  54. background-color:#032740;
  55. color:#ffffff;
  56. text-align:center;
  57. vertical-align:middle;
  58. line-height: 30px;
  59. }
  60. </style>
  61. <script language="JavaScript">
  62. function loadVis() {
  63. var container = document.getElementById('visualization');
  64. var items = [
  65. {x: '2014-06-11', y: 10},
  66. {x: '2014-06-12', y: 25},
  67. {x: '2014-06-13', y: 30},
  68. {x: '2014-06-14', y: 10},
  69. {x: '2014-06-15', y: 15},
  70. {x: '2014-06-16', y: 30}
  71. ];
  72. var dataset = new vis.DataSet(items);
  73. var options = {
  74. start: '2014-06-10',
  75. end: '2014-06-18',
  76. height:'552px',
  77. clickToUse:true
  78. };
  79. var graph2d = new vis.Graph2d(container, dataset, options);
  80. }
  81. </script>
  82. </head>
  83. <body onload="prettyPrint(); loadVis();">
  84. <h1>Graph2d Examples</h1><a class="btn btn-default" href="#allExamples" role="button">View all examples »</a> <a class="btn btn-primary" href="./docs/graph2d.html" role="button">View docs »</a>
  85. <div class="textHTMLContent">This small code example shows the easiest way to get a Graph2d up and running. This code has been taken from example 1. The working example is shown next to it. Click it to start the interaction.</div>
  86. <pre class="prettyprint lang-html">
  87. &lt;div id="visualization"&gt;&lt;/div&gt;
  88. &lt;script type="text/javascript"&gt;
  89. var container = document.getElementById('visualization');
  90. var items = [
  91. {x: '2014-06-11', y: 10},
  92. {x: '2014-06-12', y: 25},
  93. {x: '2014-06-13', y: 30},
  94. {x: '2014-06-14', y: 10},
  95. {x: '2014-06-15', y: 15},
  96. {x: '2014-06-16', y: 30}
  97. ];
  98. var dataset = new vis.DataSet(items);
  99. var options = {
  100. start: '2014-06-10',
  101. end: '2014-06-18'
  102. };
  103. var graph2d = new vis.Graph2d(container, dataset, options);
  104. &lt;/script&gt;
  105. </pre>
  106. <div id="visualization"></div>
  107. <h2 id="allExamples">All examples</h2>
  108. <div class="container-fluid">
  109. <div class="col-lg-3 col-md-3 col-sm-6">
  110. <a href="examples/graph2d/01_basic.html">
  111. <img src="./images/gallery/graph2d/01_basic.png">
  112. <div class="exampleTitle">basic</div>
  113. </a>
  114. </div>
  115. <div class="col-lg-3 col-md-3 col-sm-6">
  116. <a href="examples/graph2d/02_bars.html">
  117. <img src="./images/gallery/graph2d/02_bars.png">
  118. <div class="exampleTitle">bars</div>
  119. </a>
  120. </div>
  121. <div class="col-lg-3 col-md-3 col-sm-6">
  122. <a href="examples/graph2d/03_groups.html">
  123. <img src="./images/gallery/graph2d/03_groups.png">
  124. <div class="exampleTitle">groups</div>
  125. </a>
  126. </div>
  127. <div class="col-lg-3 col-md-3 col-sm-6">
  128. <a href="examples/graph2d/04_rightAxis.html">
  129. <img src="./images/gallery/graph2d/04_rightAxis.png">
  130. <div class="exampleTitle">right axis</div>
  131. </a>
  132. </div>
  133. <div class="col-lg-3 col-md-3 col-sm-6">
  134. <a href="examples/graph2d/05_bothAxis.html">
  135. <img src="./images/gallery/graph2d/05_bothAxis.png">
  136. <div class="exampleTitle">both axis</div>
  137. </a>
  138. </div>
  139. <div class="col-lg-3 col-md-3 col-sm-6">
  140. <a href="examples/graph2d/06_interpolation.html">
  141. <img src="./images/gallery/graph2d/06_interpolation.png">
  142. <div class="exampleTitle">interpolation</div>
  143. </a>
  144. </div>
  145. <div class="col-lg-3 col-md-3 col-sm-6">
  146. <a href="examples/graph2d/07_scrollingAndSorting.html">
  147. <img src="./images/gallery/graph2d/07_scrollingAndSorting.png">
  148. <div class="exampleTitle">scrolling and sorting</div>
  149. </a>
  150. </div>
  151. <div class="col-lg-3 col-md-3 col-sm-6">
  152. <a href="examples/graph2d/08_performance.html">
  153. <img src="./images/gallery/graph2d/08_performance.png">
  154. <div class="exampleTitle">performance</div>
  155. </a>
  156. </div>
  157. <div class="col-lg-3 col-md-3 col-sm-6">
  158. <a href="examples/graph2d/09_external_legend.html">
  159. <img src="./images/gallery/graph2d/09_external_legend.png">
  160. <div class="exampleTitle">external legend</div>
  161. </a>
  162. </div>
  163. <div class="col-lg-3 col-md-3 col-sm-6">
  164. <a href="examples/graph2d/10_barsSideBySide.html">
  165. <img src="./images/gallery/graph2d/10_barsSideBySide.png">
  166. <div class="exampleTitle">bars side by side</div>
  167. </a>
  168. </div>
  169. <div class="col-lg-3 col-md-3 col-sm-6">
  170. <a href="examples/graph2d/11_barsSideBySideGroups.html">
  171. <img src="./images/gallery/graph2d/11_barsSideBySideGroups.png">
  172. <div class="exampleTitle">bars side by side groups</div>
  173. </a>
  174. </div>
  175. <div class="col-lg-3 col-md-3 col-sm-6">
  176. <a href="examples/graph2d/12_customRange.html">
  177. <img src="./images/gallery/graph2d/12_customRange.html.png">
  178. <div class="exampleTitle">custom range</div>
  179. </a>
  180. </div>
  181. <div class="col-lg-3 col-md-3 col-sm-6">
  182. <a href="examples/graph2d/13_localization.html">
  183. <img src="./images/gallery/graph2d/13_localization.png">
  184. <div class="exampleTitle">localization</div>
  185. </a>
  186. </div>
  187. <div class="col-lg-3 col-md-3 col-sm-6">
  188. <a href="examples/graph2d/14_toggleGroups.html">
  189. <img src="./images/gallery/graph2d/14_toggleGroups.png">
  190. <div class="exampleTitle">toggle groups</div>
  191. </a>
  192. </div>
  193. <div class="col-lg-3 col-md-3 col-sm-6">
  194. <a href="examples/graph2d/15_streaming_data.html">
  195. <img src="./images/gallery/graph2d/15_streaming_data.png">
  196. <div class="exampleTitle">streaming data</div>
  197. </a>
  198. </div>
  199. <div class="col-lg-3 col-md-3 col-sm-6">
  200. <a href="examples/graph2d/16_bothAxis_titles.html">
  201. <img src="./images/gallery/graph2d/16_bothAxis_titles.png">
  202. <div class="exampleTitle">axis titles</div>
  203. </a>
  204. </div>
  205. <div class="col-lg-3 col-md-3 col-sm-6">
  206. <a href="examples/graph2d/17_dynamicStyling.html">
  207. <img src="./images/gallery/graph2d/17_dynamicStyling.png">
  208. <div class="exampleTitle">dynamic styling</div>
  209. </a>
  210. </div>
  211. </div>
  212. <br />
  213. <br />
  214. <br />
  215. <br />
  216. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  217. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  218. <!-- Include all compiled plugins (below), or include individual files as needed -->
  219. <script src="js/bootstrap.min.js"></script>
  220. </body>
  221. </html>