1.首先,在https://www.hcharts.cn/下载Highcharts的组件。

2.然后,引用

 <script src="../code/highcharts.js"></script> 

3.html:

  <div id="container" style="width: 550px; height: 400px;">
</div>

4.js

  function getselect(Number_cp) {
Number_cp = $(".Number_cp").val();
$.ajax({
url: "../Ajax/DataStatistics.ashx?action=select",
type: "POST",
dataType: "text",
data: {
Number_cp: Number_cp
},
success: function (data) {
var s = data;
var model = eval(s);
a = "";
for (var i = 0; i < model.length; i++) {
var m = model[i].Quantity;
a += m + ",";
}
series_data = "";
series_data = a.substring(0, a.length - 1);
getQuantity(series_data);
}
})
}
function getQuantity(series_data) {
var chart = Highcharts.chart('container', {
chart: {
type: 'line'
},
credits: {
enabled: false //不显示LOGO
},
title: {
text: '产品数量/每月'
},
legend: {
align: 'right',
verticalAlign: 'top',
y: 60
},
xAxis: {
softMin: 1,
title: {
text: '月份'
},
categories: ['一月', '二月', '三月', '四月', '五月', '六月', '七月', '八月', '九月', '十月', '十一月', '十二月']
},
yAxis: {
softMax: 4000,
tickAmount: 9,
title: {
text: '产品数量'
},
},
plotOptions: {
line: {
dataLabels: {
enabled: true
},
enableMouseTracking: false
}
},
series: [{
name: '产品数量',
data: eval("[" + series_data + "]")
}],
});
}

5.效果图:

最新文章

  1. win2008server系统下文件替换权限
  2. STL——临时对象的产生与运用
  3. 非常不错的android应用开发详解在安卓开发中
  4. 安装Eclipse(android)新建项目时遇到的问题
  5. GPIO控制LED
  6. CentOS 7 最小安装网络配置
  7. Unable to start web server; nested exception is org.springframework.context.ApplicationContextException: Unable to start ServletWebServerApplicationContext due to missing ServletWebServerFactory bean.
  8. linux下查看进程id时用到的命令
  9. 宝塔MySQL服务自动停止重启的解决方法
  10. centos7安装git踩坑记
  11. docker push 出现:x509: certificate signed by unknown authority
  12. Linux 文件查找(find)
  13. (五)ROS节点
  14. 杭电1133 排队买票 catalan
  15. 不使用第三方软件、使用IE11自带功能来屏蔽浏览器广告
  16. SAP全球企业官孙小群的生活智慧
  17. Android MediaPlayer 操作
  18. cin和cout详解
  19. jQuery 自制上传头像插件-附带Demo实例(ajaxfileupload.js第三弹)
  20. 关于IIS上Yii2的Url路由美化

热门文章

  1. 关于Date
  2. nginx状态码
  3. Mysql Errors
  4. [CDH] Redis: Remote Dictionary Server
  5. delphi读写INI系统配置文件
  6. TextInput组件的常用属性
  7. Java泛型(7):无界通配符&lt;?&gt;
  8. DS1302时钟基础使用(含代码)
  9. v-on可以监听多个方法吗?
  10. Mybatis 属性配置