Jqplot柱图前台代码
来源:互联网 发布:山石网络待遇 编辑:程序博客网 时间:2024/06/10 08:49
引入jqplot相关js,css文件:
<script type="text/javascript" src="../../common/js/jqplot/jquery.jqplot.min.js"></script><!--[if IE]><script language="javascript" type="text/javascript" src="../../common/js/jqplot/excanvas.js"></script><![endif]-->
<script type="text/javascript" src="../../common/js/jqplot/plugins/jqplot.canvasAxisLabelRenderer.min.js"></script>
<script type="text/javascript" src="../../common/js/jqplot/plugins/jqplot.categoryAxisRenderer.min.js"></script>
<script type="text/javascript" src="../../common/js/jqplot/plugins/jqplot.canvasTextRenderer.min.js"></script>
<script type="text/javascript" src="../../common/js/jqplot/plugins/jqplot.pointLabels.min.js"></script>
<script type="text/javascript" src="../../common/js/jqplot/plugins/jqplot.barRenderer.min.js"></script>
<link rel="stylesheet" type="text/css" href="../../common/css/jqplot/jquery.jqplot.css"></link>
//图例说明变量
var legends = [{label:'预测销量'},{label:'实际销量'},{label:'整体MAPE'},{label:'平均MAPE'},{label:'不分仓SKU数量'},{label:'分仓SKU数量'},{label:'促销天数'},{label:'库存异常天数'}];
v
//绘制柱图
var plot1 = $.jqplot('chartdiv',values,{//设置统计图柱图属性
seriesDefaults: {
stackSeries: true,
captureRightClick: true,
renderer:$.jqplot.BarRenderer, //显示为柱图
labelRenderer: $.jqplot.CanvasAxisLabelRenderer,
pointLabels: { show: true }//,
},
//设置横纵坐标样式
axes: {
//X轴
xaxis: {
renderer: $.jqplot.CategoryAxisRenderer, //渲染器
ticks:ticks //X轴坐标
},
//Y轴
yaxis: {
tickOptions:{formatString:'%.2f'}//设置数据格式
}
},
series:legends, //图例说明数据
legend:{
show: true, //是否显示图例说明
showLabels: true , //是否显示框
location: 'e', //图例显示位置
placement: 'outsideGrid' //图例是否在统计图中
}
});
<div id="chartdiv" style="height:300px;width:1000px;"></div>
显示的div中样式中的高度和宽度是不能省略的,否则在IE浏览器中出现实现错误。
统计图中的数据格式为数组格式,如果每个横坐标中的有多个柱图,那么数据格式为[[横坐标1数据1,横坐标2数据1],[横坐标1数据2,横坐标2数据1]]
- Jqplot柱图前台代码
- 利用JqPlot画饼图
- JQPLOT
- jqplot折线图实现 例子
- 前台代码
- jqplot通过ajax动态画折线图
- jqplot 折线图 x轴设置
- 学生信息管理前台代码
- 前台调用后台代码
- 三级联动前台代码
- 前台表格代码
- Jqplot图形报表-绘制饼图、柱状图、折线图....
- jqplot画圆饼图时候自定义文字内容
- 使用jquery图表插件jqplot之折线图
- jqPlot图表插件学习之饼状图和环状图
- jqPlot图表插件学习之饼状图和环状图
- jqPlot图表插件学习之饼状图和环状图
- jqplot 饼图
- Java冒泡排序
- C#中MessageBox用法大全(附效果图)
- NFS配置随手记录
- isodata
- 2012大数据盘点
- Jqplot柱图前台代码
- Project configuration is not up-to-date with pom.xml
- [oracle][toad]TOAD连接ORACLE而不装ORACLE 客户端的方法
- 2010年 浙工大考研计算机专业课试题C++
- linux网络测速工具Speedometer(嵌入式工具集合)
- Linux内核中的PID散列表实例
- Cocoa中监听、观察和通知的五种方法
- HTML+CSS+JS实现左边栏滑动框带关闭按钮
- c#同步Socket