设为首页收藏本站

birt家园

 找回密码
 立即注册

QQ登录

只需一步,快速开始

查看: 3137|回复: 0

RGraph 官方图表示例(十六)雷达图

[复制链接]
发表于 2012-8-10 10:33:12 | 显示全部楼层 |阅读模式
这是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 Radar chart</title>
  7.         <meta name="keywords" content="rgraph html5 canvas example radar charts" />
  8.         <meta name="description" content="An example of the Radar chart 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.context.js" ></script>
  19.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.dynamic.js" ></script>
  20.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.tooltips.js" ></script>
  21.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.common.key.js" ></script>
  22.         <script src="${ctx}/script/html5/rgraph/libraries/RGraph.radar.js" ></script>
  23.                 <!--[if lt IE 9]><script src="${ctx}/script/html5/rgraph/excanvas/excanvas.original.js"></script><![endif]-->
  24.         <script>
  25.             $(function(){
  26.                 _createChart();
  27.             });
  28.             /**
  29.              * 雷达图
  30.              */
  31.             function _createChart(){
  32.                 var radar = new RGraph.Radar('radar1', [7,6,6,7,8,6,7,7,6,6], [4,5,6,10,4,3,5,4,6,5], [4,3,5,7,6,5,3,2,4,5]);
  33.                 radar.Set('chart.strokestyle', 'black');
  34.                 radar.Set('chart.colors.alpha', 0.3);
  35.                 radar.Set('chart.colors', ['red', 'green', 'yellow']);
  36.                 if (!RGraph.isOld()) {
  37.                     radar.Set('chart.tooltips.effect', 'snap');
  38.                     radar.Set('chart.tooltips', [
  39.                         'Pete','Lou','Jim','Jack','Fred','Jo','Lou','Freda','Pete','Rick',
  40.                         'Pete','Lou','Jim','Jack','Fred','Jo','Lou','Freda','Pete','Rick',
  41.                         'Pete','Lou','Jim','Jack','Fred','Jo','Lou','Freda','Pete','Rick'
  42.                     ]);
  43.                 }
  44.                 radar.Set('chart.key', ['2000','2001','2002']);
  45.                 radar.Set('chart.key.position', 'graph');
  46.                 radar.Set('chart.labels', ['Pete','Lou','Jim','Jack','Fred','Jo','Lou','Freda','Pete','Rick']);
  47.                 radar.Set('chart.gutter.top', 35);
  48.                 radar.Set('chart.accumulative', true);
  49.                 radar.Draw();
  50.         </script>
  51.     </head>
  52.     <body>
  53.         <div style="text-align: center">
  54.             <canvas id="radar1" width="450" height="300">[No canvas support]</canvas>
  55.         </div>
  56.     </div>
  57. </body>
  58. </html>
复制代码

本帖子中包含更多资源

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

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

本版积分规则

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

GMT+8, 2020-8-7 16:59 , Processed in 0.199372 second(s), 21 queries .

Powered by Discuz! X3.2

© 2001-2013 Comsenz Inc.

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