PageRenderTime 43ms CodeModel.GetById 15ms RepoModel.GetById 0ms app.codeStats 0ms

/peanut_web/Calibrators/RGraph/examples/progress.html

http://atcacode.googlecode.com/
HTML | 138 lines | 99 code | 23 blank | 16 comment | 0 complexity | 7ca3a58bc2cdf0d8cdedcadef0c067c7 MD5 | raw file
Possible License(s): GPL-2.0
  1. <?php ob_start('ob_gzhandler') ?>
  2. <!DOCTYPE html>
  3. <html>
  4. <head>
  5. <meta http-equiv="X-UA-Compatible" content="chrome=1">
  6. <!--
  7. /**
  8. * o------------------------------------------------------------------------------o
  9. * | This file is part of the RGraph package - you can learn more at: |
  10. * | |
  11. * | http://www.rgraph.net |
  12. * | |
  13. * | This package is licensed under the RGraph license. For all kinds of business |
  14. * | purposes there is a small one-time licensing fee to pay and for non |
  15. * | commercial purposes it is free to use. You can read the full license here: |
  16. * | |
  17. * | http://www.rgraph.net/LICENSE.txt |
  18. * o------------------------------------------------------------------------------o
  19. */
  20. -->
  21. <title>RGraph: HTML5 canvas graph library - progress bar</title>
  22. <link rel="stylesheet" href="../css/website.css" type="text/css" media="screen" />
  23. <link rel="icon" type="image/png" href="/favicon.png">
  24. <script src="../libraries/RGraph.common.js"></script>
  25. <script src="../libraries/RGraph.progress.js"></script>
  26. <!--[if IE]><script src="../excanvas/excanvas.compressed.js"></script><![endif]-->
  27. <script>
  28. window.onload = function ()
  29. {
  30. var progress1 = new RGraph.Progress('progress1', 63, 100);
  31. progress1.Set('chart.tickmarks', false);
  32. progress1.Set('chart.arrows', true);
  33. if (!document.all) {
  34. progress1.Set('chart.annotatable', true);
  35. progress1.Set('chart.contextmenu', [['Zoom in', RGraph.Zoom], ['Show the palette', RGraph.Showpalette], ['Clear', function () {RGraph.Clear(progress1.canvas, '#fff'); progress1.Draw();}]]);
  36. }
  37. progress1.Draw();
  38. /**
  39. * This draws the sdecond progress bar
  40. */
  41. var gradient = progress1.context.createLinearGradient(0,0,450,0);
  42. gradient.addColorStop(0, 'red');
  43. gradient.addColorStop(0.3, 'yellow');
  44. gradient.addColorStop(1, '#6f6');
  45. var progress2 = new RGraph.Progress('progress2', 96, 100);
  46. progress2.Set('chart.color', gradient);
  47. progress2.Set('chart.shadow', true);
  48. progress2.Set('chart.title', 'Disk usage (tooltip, context menu)');
  49. progress2.Set('chart.units.post', 'Gb');
  50. if (!document.all) {
  51. progress2.Set('chart.tooltips', ['<b>Warning!</b><br />Disk usage is high. It might be time to delete<br /> some of your files']);
  52. progress2.Set('chart.contextmenu', [['A sample context menu', function () {}]]);
  53. }
  54. progress2.Draw();
  55. var progress3 = new RGraph.Progress('progress3', 7, 10);
  56. progress3.Set('chart.color', 'rgb(123,215,155)');
  57. progress3.Set('chart.tickmarks', false);
  58. progress3.Set('chart.orientation', 'vertical');
  59. progress3.Set('chart.arrows', true);
  60. progress3.Draw();
  61. var progress4 = new RGraph.Progress('progress4', 1, 10);
  62. progress4.Set('chart.color', 'red');
  63. progress4.Set('chart.gutter', 30);
  64. progress4.Set('chart.orientation', 'vertical');
  65. if (!document.all) {
  66. progress4.Set('chart.tooltips', ['<b>Danger</b><br />The water tank is getting very low!']);
  67. }
  68. progress4.Draw();
  69. var progress5 = new RGraph.Progress('progress5', 14, 50);
  70. progress5.Set('chart.color', 'yellow');
  71. progress5.Set('chart.gutter', 30);
  72. progress5.Set('chart.orientation', 'vertical');
  73. progress5.Draw();
  74. }
  75. </script>
  76. </head>
  77. <body>
  78. <div id="breadcrumb">
  79. <a href="../index.html">RGraph: HTML5 canvas graph library</a>
  80. >
  81. <a href="./index.html">Examples</a>
  82. >
  83. Progress bar
  84. </div>
  85. <h1>RGraph: HTML5 canvas graph library - Progress bar</h1>
  86. <script>
  87. if (document.all) {
  88. document.write('<div style="background-color: #fee; border: 2px dashed red; padding: 5px"><b>Important</b><br /><br /> Internet Explorer does not natively support the HTML5 canvas tag yet, so if you want to see the graphs, you can either:<ul><li>Install <a href="http://code.google.com/chrome/chromeframe/">Google Chrome Frame</a></li><li>Use ExCanvas. This is provided in the RGraph Archive.</li><li>Use another browser entirely. Your choices are Firefox 3.5+, Chrome 2+, Safari 4+ or Opera 10.5+. </li></ul></div>');
  89. }
  90. </script>
  91. <p>
  92. This is a Progress Bar for showing, well, progress. Though you can show anything with it - use it to show load on your server,
  93. or percentage space free on your servers disk drive. You could even incorporate it with some AJAX to retrieve status information
  94. from your webserver dynamically, making the Progress Bar realtime. To redraw the progress bar simply call <i>RGraph.Clear()</i>
  95. (which clears the canvas) and then call <i>myProgress.Draw()</i> again.
  96. </p>
  97. <p>
  98. The colours, title and scale are configurable, allowing you to represent a wide range of values.
  99. </p>
  100. <div>
  101. <ul>
  102. <li><a href="../docs/progress.html">Progress bar API documentation</a></li>
  103. </ul>
  104. </div>
  105. <div style="float: left; width: 48%">
  106. <canvas width="450" height="75" id="progress1">[No canvas support]</canvas>
  107. <canvas width="450" height="75" id="progress2">[No canvas support]</canvas>
  108. </div>
  109. <div style="float: right; width: 48%">
  110. <canvas width="100" height="370" id="progress3">[No canvas support]</canvas>
  111. <canvas width="100" height="370" id="progress4">[No canvas support]</canvas>
  112. <canvas width="100" height="370" id="progress5">[No canvas support]</canvas>
  113. </div>
  114. </body>
  115. </html>