欢迎您访问程序员文章站本站旨在为大家提供分享程序员计算机编程知识!
您现在的位置是: 首页  >  IT编程

jQuery插件FusionCharts绘制的2D帕累托图效果示例【附demo源码】

程序员文章站 2023-11-16 15:57:58
本文实例讲述了jquery插件fusioncharts绘制的2d帕累托图效果。分享给大家供大家参考,具体如下: 1、了解帕累托图的特性以及和其他图的共性 2、设计帕累托...

本文实例讲述了jquery插件fusioncharts绘制的2d帕累托图效果。分享给大家供大家参考,具体如下:

1、了解帕累托图的特性以及和其他图的共性

2、设计帕累托图页面中引入图的类型以及怎么引入到页面

index.html:

<!doctype html public "-//w3c//dtd html 4.01 transitional//en"
"http://www.w3.org/tr/html4/loose.dtd">
<html>
<head>
<meta http-equiv="content-type" content="text/html; charset=utf-8">
<title>fusioncharts pareto2d图</title>
<script type="text/javascript" src="jquery-1.7.2.min.js"></script>
<script type="text/javascript" src="fusioncharts/fusioncharts.js"></script>
<script type="text/javascript">
$(function(){
 var pareto2d = new fusioncharts( "fusioncharts/pareto2d.swf", "pareto2did", "100%", "540", "0" );
 pareto2d.setxmlurl("pareto2d.xml");
 pareto2d.render("pareto2dchart");
});
</script>
</head>
<body>
  <div id="pareto2dchart"></div>
</body>
</html>

3、设计帕累托图的数据源

pareto2d.xml:

<?xml version="1.0" encoding="utf-8"?>
<chart caption="(jb51.net)一周统计人数" xaxisname="星期" pyaxisname ="人数" plotgradientcolor="" showvalues='0'
    basefont='微软雅黑' basefontsize='20' basefontcolor='#654545' outcnvbasefont='宋体'
    outcnvbasefontsize='24' outcnvbasefontcolor='#989899' drawanchors='1' anchorsides='4'
    anchorradius='10' anchorbordercolor='#ff0000' anchorborderthickness='1' anchorbgcolor='#00ff00'
    anchoralpha='50' anchorbgalpha='50' numdivlines='8' divlineisdashed='1'>
  <set label="星期一" value="205"/>
  <set label="星期二" value="165"/>
  <set label="星期三" value="85"/>
  <set label="星期四" value="62"/>
  <set label="星期五" value="73"/>
  <set label="星期六" value="109"/>
  <set label="星期日" value="121"/>
</chart>

4、运行结果

jQuery插件FusionCharts绘制的2D帕累托图效果示例【附demo源码】

附:完整实例代码点击此处本站下载

注:该源码需要放到服务器环境下运行!否则无法加载xml文件数据。

更多关于jquery相关内容感兴趣的读者可查看本站专题:《jquery常用插件及用法总结》、《jquery中ajax用法总结》、《jquery表格(table)操作技巧汇总》、《jquery扩展技巧总结》、《jquery常见经典特效汇总》及《jquery选择器用法总结

希望本文所述对大家jquery程序设计有所帮助。