设为首页收藏本站

birt家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3016|回复: 0

RGraph 官方图表示例(二十一)垂直进度条

[复制链接]
发表于 2012-8-14 10:17:44 | 显示全部楼层 |阅读模式
这是RGraph 官方的垂直进度条示例   
效果如下:


代码如下:
  1. <%@ include file="/common/tags.jsp"%>
  2. <%@ page contentType="text/html; charset=utf-8"%>
  3. <!DOCTYPE html>
  4. <html>
  5.     <head>
  6.         <title>RGraph: An example of the Vertical Progress Bar</title>
  7.         <meta name="keywords" content="rgraph html5 canvas example vertical progress bar" />
  8.         <meta name="description" content="An example of the Vertical Progress Bar that RGraph can produce" />
  9.         <meta name="googlebot" content="NOODP">
  10.         <meta property="og:title" content="RGraph: HTML5 Javascript charts library" />
  11.         <meta property="og:description" content="A charts library based on the HTML5 canvas tag" />
  12.         <meta property="og:image" content="http://www.rgraph.net/images/logo.png"/>
  13.         <link rel="stylesheet" href="${ctx}/script/html5/rgraph/css/website.css" type="text/css" media="screen" />
  14.         <link rel="icon" type="image/png" href="${ctx}/script/html5/rgraph/images/favicon.png">
  15.         <!-- Place this tag in your head or just before your close body tag -->
  16.         <script type="text/javascript" src="https://apis.google.com/js/plusone.js"></script>
  17.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.core.js"></script>
  18.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.dynamic.js" ></script>
  19.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.tooltips.js" ></script>
  20.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.vprogress.js"></script>
  21.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.key.js" ></script>
  22.             <!--[if lt IE 9]><script src="${ctx}/script/html5/rgraph/excanvas/excanvas.original.js"></script><![endif]-->
  23.         <script>
  24.             $(function(){
  25.                 _createChart();
  26.             });
  27.             /**
  28.              * 垂直进度条
  29.              */
  30.             function _createChart(){
  31.                 var progress3 = new RGraph.VProgress('progress3', [1.455, 13, 42], 100);
  32.                 progress3.Set('chart.colors', ['red', '#cfc', 'blue']);
  33.                 progress3.Set('chart.margin', 5);
  34.                 if (!RGraph.isOld()) {
  35.                     progress3.Set('chart.tooltips', [function () {return 'John';}, 'id:fred', 'Pete']);
  36.                 }
  37.                 progress3.Set('chart.tooltips.effect', 'fade');
  38.                 progress3.Set('chart.tickmarks', true);
  39.                 progress3.Set('chart.tickmarks.inner', true);
  40.                 progress3.Set('chart.tickmarks.color', '#333');
  41.                 progress3.Set('chart.key', ['Richard','Fred','Bob']);
  42.                 progress3.Set('chart.key.position.x', progress3.canvas.width - 90);
  43.                 progress3.Set('chart.tickmarks.zerostart', true);
  44.                 progress3.Set('chart.gutter.right', 125);
  45.                 progress3.Set('chart.scale.decimals', 1);
  46.                 progress3.Draw();
  47.             }
  48.         </script>
  49.     </head>
  50.     <body>
  51.         <script>
  52.             if (RGraph.isOld()) {
  53.                 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, so if you want to see the charts, 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> <b>Note:</b> Internet Explorer 9 fully supports the canvas tag.</div>');
  54.             }
  55.         </script>
  56.         <div style="text-align: center">
  57.             <canvas width="210" height="450" id="progress3">[No canvas support]</canvas>
  58.         </div>
  59.         <div id="fred" style="display: none">Fred</div>
  60.     </body>
  61. </html>
复制代码

本帖子中包含更多资源

您需要 登录 才可以下载或查看,没有帐号?立即注册

x
您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Archiver|手机版|小黑屋|birt家园    

GMT+8, 2020-8-7 11:46 , Processed in 0.261292 second(s), 19 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

快速回复 返回顶部 返回列表