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.

243 lines
8.9 KiB

9 years ago
  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. font-family: Lustria,Georgia,Times,"Times New Roman",serif !important;
  24. }
  25. pre {
  26. width:450px;
  27. height:552px;
  28. overflow:auto;
  29. }
  30. #visualization {
  31. display:block;
  32. margin-left:470px;
  33. margin-top:-562px;
  34. width:500px;
  35. height:552px;
  36. border: 1px solid #dddddd;
  37. border-radius:4px;
  38. background-color:#fcfcfc;
  39. }
  40. div.textHTMLContent {
  41. margin-top:10px;
  42. margin-bottom:10px;
  43. display:block;
  44. width:800px;
  45. }
  46. img {
  47. border:1px solid #dddddd;
  48. width:250px;
  49. height:250px;
  50. border-radius:10px;
  51. margin-top:10px;
  52. }
  53. div.exampleTitle {
  54. position:relative;
  55. top:-7px;
  56. width:100%;
  57. max-width:250px;
  58. height:30px;
  59. border: 1px solid #dddddd;
  60. background-color: #526b84;
  61. color:#ffffff;
  62. text-align:center;
  63. vertical-align:middle;
  64. line-height: 30px;
  65. border-bottom-left-radius:5px;
  66. border-bottom-right-radius:5px;
  67. }
  68. </style>
  69. <script language="JavaScript">
  70. function loadVis() {
  71. var container = document.getElementById('visualization');
  72. var items = [
  73. {x: '2014-06-11', y: 10},
  74. {x: '2014-06-12', y: 25},
  75. {x: '2014-06-13', y: 30},
  76. {x: '2014-06-14', y: 10},
  77. {x: '2014-06-15', y: 15},
  78. {x: '2014-06-16', y: 30}
  79. ];
  80. var dataset = new vis.DataSet(items);
  81. var options = {
  82. start: '2014-06-10',
  83. end: '2014-06-18',
  84. height:'552px',
  85. clickToUse:true
  86. };
  87. var graph2d = new vis.Graph2d(container, dataset, options);
  88. }
  89. </script>
  90. </head>
  91. <body onload="prettyPrint(); loadVis();">
  92. <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>
  93. <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>
  94. <pre class="prettyprint lang-html">
  95. &lt;div id="visualization"&gt;&lt;/div&gt;
  96. &lt;script type="text/javascript"&gt;
  97. var container = document.getElementById('visualization');
  98. var items = [
  99. {x: '2014-06-11', y: 10},
  100. {x: '2014-06-12', y: 25},
  101. {x: '2014-06-13', y: 30},
  102. {x: '2014-06-14', y: 10},
  103. {x: '2014-06-15', y: 15},
  104. {x: '2014-06-16', y: 30}
  105. ];
  106. var dataset = new vis.DataSet(items);
  107. var options = {
  108. start: '2014-06-10',
  109. end: '2014-06-18'
  110. };
  111. var graph2d = new vis.Graph2d(container, dataset, options);
  112. &lt;/script&gt;
  113. </pre>
  114. <div id="visualization"></div>
  115. <h2 id="allExamples">All examples</h2>
  116. <div class="container-fluid">
  117. <div class="col-lg-2 col-md-3 col-sm-6">
  118. <a href="examples/graph2d/01_basic.html">
  119. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/1.png">
  120. <div class="exampleTitle">basic</div>
  121. </a>
  122. </div>
  123. <div class="col-lg-2 col-md-3 col-sm-6">
  124. <a href="examples/graph2d/02_bars.html">
  125. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/2.png">
  126. <div class="exampleTitle">bars</div>
  127. </a>
  128. </div>
  129. <div class="col-lg-2 col-md-3 col-sm-6">
  130. <a href="examples/graph2d/03_groups.html">
  131. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/3.png">
  132. <div class="exampleTitle">groups</div>
  133. </a>
  134. </div>
  135. <div class="col-lg-2 col-md-3 col-sm-6">
  136. <a href="examples/graph2d/04_rightAxis.html">
  137. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/4.png">
  138. <div class="exampleTitle">right axis</div>
  139. </a>
  140. </div>
  141. <div class="col-lg-2 col-md-3 col-sm-6">
  142. <a href="examples/graph2d/05_bothAxis.html">
  143. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/5.png">
  144. <div class="exampleTitle">both axis</div>
  145. </a>
  146. </div>
  147. <div class="col-lg-2 col-md-3 col-sm-6">
  148. <a href="examples/graph2d/06_interpolation.html">
  149. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/6.png">
  150. <div class="exampleTitle">interpolation</div>
  151. </a>
  152. </div>
  153. <div class="col-lg-2 col-md-3 col-sm-6">
  154. <a href="examples/graph2d/07_scrollingAndSorting.html">
  155. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/7.png">
  156. <div class="exampleTitle">scrolling and sorting</div>
  157. </a>
  158. </div>
  159. <div class="col-lg-2 col-md-3 col-sm-6">
  160. <a href="examples/graph2d/08_performance.html">
  161. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/8.png">
  162. <div class="exampleTitle">performance</div>
  163. </a>
  164. </div>
  165. <div class="col-lg-2 col-md-3 col-sm-6">
  166. <a href="examples/graph2d/09_external_legend.html">
  167. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/9.png">
  168. <div class="exampleTitle">external legend</div>
  169. </a>
  170. </div>
  171. <div class="col-lg-2 col-md-3 col-sm-6">
  172. <a href="examples/graph2d/10_barsSideBySide.html">
  173. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/10.png">
  174. <div class="exampleTitle">bars side by side</div>
  175. </a>
  176. </div>
  177. <div class="col-lg-2 col-md-3 col-sm-6">
  178. <a href="examples/graph2d/11_barsSideBySideGroups.html">
  179. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/11.png">
  180. <div class="exampleTitle">bars side by side groups</div>
  181. </a>
  182. </div>
  183. <div class="col-lg-2 col-md-3 col-sm-6">
  184. <a href="examples/graph2d/12_customRange.html">
  185. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/12.png">
  186. <div class="exampleTitle">custom range</div>
  187. </a>
  188. </div>
  189. <div class="col-lg-2 col-md-3 col-sm-6">
  190. <a href="examples/graph2d/13_localization.html">
  191. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/13.png">
  192. <div class="exampleTitle">localization</div>
  193. </a>
  194. </div>
  195. <div class="col-lg-2 col-md-3 col-sm-6">
  196. <a href="examples/graph2d/14_toggleGroups.html">
  197. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/14.png">
  198. <div class="exampleTitle">toggle groups</div>
  199. </a>
  200. </div>
  201. <div class="col-lg-2 col-md-3 col-sm-6">
  202. <a href="examples/graph2d/15_streaming_data.html">
  203. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/15.png">
  204. <div class="exampleTitle">streaming data</div>
  205. </a>
  206. </div>
  207. <div class="col-lg-2 col-md-3 col-sm-6">
  208. <a href="examples/graph2d/16_bothAxis_titles.html">
  209. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/16.png">
  210. <div class="exampleTitle">axis titles</div>
  211. </a>
  212. </div>
  213. <div class="col-lg-2 col-md-3 col-sm-6">
  214. <a href="examples/graph2d/17_dynamicStyling.html">
  215. <img class="img-responsive" src="./images/exampleScreenshots/graph2d/17.png">
  216. <div class="exampleTitle">dynamic styling</div>
  217. </a>
  218. </div>
  219. </div>
  220. <br />
  221. <br />
  222. <br />
  223. <br />
  224. <!-- jQuery (necessary for Bootstrap's JavaScript plugins) -->
  225. <script src="https://ajax.googleapis.com/ajax/libs/jquery/1.11.1/jquery.min.js"></script>
  226. <!-- Include all compiled plugins (below), or include individual files as needed -->
  227. <script src="js/bootstrap.min.js"></script>
  228. </body>
  229. </html>