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.

49 lines
1.4 KiB

  1. <!DOCTYPE HTML>
  2. <html>
  3. <head>
  4. <title>Timeline | RTL example</title>
  5. <script src="../../../dist/vis.js"></script>
  6. <link href="../../../dist/vis-timeline-graph2d.min.css" rel="stylesheet" type="text/css" />
  7. <script src="../../googleAnalytics.js"></script>
  8. </head>
  9. <body>
  10. <h1>Timeline RTL support</h1>
  11. <h2>Using <code>dir = "rtl"</code> in any parent node</h2>
  12. <div id="timeline1" dir="rtl"></div>
  13. <h2>Using <code>options.rtl = true</code></h2>
  14. <div id="timeline2"></div>
  15. <script>
  16. var items = new vis.DataSet();
  17. // add items to the DataSet
  18. items.add([
  19. {id: 1, content: '2014-01-23 <br>start', start: '2014-01-23'},
  20. {id: 2, content: '2014-01-18', start: '2014-01-18'},
  21. {id: 3, content: '2014-01-21', start: '2014-01-21'},
  22. {id: 4, content: '2014-01-19 - 2014-01-24', start: '2014-01-19', end: '2014-01-24'},
  23. {id: 5, content: '2014-01-28', start: '2014-01-28', type:'point'},
  24. {id: 6, content: '2014-01-26', start: '2014-01-26'}
  25. ]);
  26. var container1 = document.getElementById('timeline1');
  27. var container2 = document.getElementById('timeline2');
  28. var options = {
  29. start: '2014-01-10',
  30. end: '2014-02-10',
  31. height: '300px',
  32. };
  33. var options1 = Object.assign({}, options)
  34. var timeline1 = new vis.Timeline(container1, items, options1);
  35. var options2 = Object.assign({rtl: true}, options)
  36. var timeline2 = new vis.Timeline(container2, items, options2);
  37. </script>
  38. </body>
  39. </html>