jqPlot jquery的页面图表绘制工具

2020-05-24 21:23:16易采站长站整理

<html lang=”en”>
<head>
<meta http-equiv=”Content-Type” content=”text/html; charset=utf-8″>
<title>Simple Test</title>
<!–[if IE]><script language=”javascript” type=”text/javascript” src=”./excanvas.js”></script><![endif]–>
<link rel=”stylesheet” type=”text/css” href=”./jquery.jqplot.css” />
<script language=”javascript” type=”text/javascript” src=”./jquery-1.3.2.min.js”></script>
<script language=”javascript” type=”text/javascript” src=”./jquery.jqplot.js”></script>
<script language=”javascript” type=”text/javascript” src=”./plugins/jqplot.pieRenderer.js”></script>
<script type=”text/javascript” language=”javascript”>
$(document).ready(function(){
line1 = [[‘frogs’, 3], [‘buzzards’, 7], [‘deer’, 2.5], [‘turkeys’, 6], [‘moles’, 5], [‘ground hogs’, 4]];
plot1 = $.jqplot(‘chart’, [line1], {
title:’pieRenderer ‘,//设置饼状图的标题
seriesDefaults: {fill: true,
showMarker: false,
shadow: false,
renderer:$.jqplot.PieRenderer,
rendererOptions:{
diameter: undefined, // 设置饼的直径
padding: 20, // 饼距离其分类名称框或者图表边框的距离,变相该表饼的直径
sliceMargin: 9, // 饼的每个部分之间的距离
fill:true, // 设置饼的每部分被填充的状态
shadow:true, //为饼的每个部分的边框设置阴影,以突出其立体效果
shadowOffset: 2, //设置阴影区域偏移出饼的每部分边框的距离
shadowDepth: 5, // 设置阴影区域的深度
shadowAlpha: 0.07 // 设置阴影区域的透明度
}
},
legend:{
show: true,//设置是否出现分类名称框(即所有分类的名称出现在图的某个位置)
location: ‘ne’, // 分类名称框出现位置, nw, n, ne, e, se, s, sw, w.
xoffset: 12, // 分类名称框距图表区域上边框的距离(单位px)
yoffset: 12, // 分类名称框距图表区域左边框的距离(单位px)
}
});
});
</script>
</head>
<body>
<div id=”chart” style=”margin-top:20px; margin-left:20px; width:460px; height:500px;”></div>
</body>
</html>


生成图表展示如下:


<IMG title="jqPlot——基于jquery的页面图表绘制工具 – gaoyusi – My code life” alt=”jqPlot——基于jquery的页面图表绘制工具 – gaoyusi – My code life” src=”https://www.easck.com/d/file/200524/20200524211945198.jpg”>


下面是一些其他类型的图标的截图: