<div class="row">

                                <div class="col-md-12">
<div id="container"></div>
</div>
</div>
<script src="~/Scripts/Highcharts-6.0.7/code/highcharts.js"></script>
<script language="JavaScript">
var pageIndex = ;
var pageSize = ;
var industrys = []; //所有行业
var notcounts = []; //待上报
var notauditcounts = []; //待审核
var sooncount = []; //即将到期
var overduecount = [];//已过期 function LoadData() {
var params = {};
var url = "/api/industry/GetAllList"; //接口地址
ajaxGet(url, params, function (rs) {
if (!rs.status) {
layer.msg("请求出错,请稍后重试" + rs.errmsg, { icon: , time: });
return;
} for (var i = ; i < rs.data.length; i++) { industrys.push(rs.data[i].name);
//根据行业id查询该行业待上报、待审核、即将过期、已过期的数量 var params = {
company_type: rs.data[i].name
};
var url = "/api/report/GetHomeCount";
ajaxPost(url, params, function (data) {
if (!data.data == null) {
layer.msg("无数据" + data.errmsg, { icon: , time: });
return;
}
else {
notcounts.push(data.data.notcount);
notauditcounts.push(data.data.notauditcount);
sooncount.push(data.data.sooncount);
overduecount.push(data.data.overduecount); var chart = {
type: 'column'
};
var title = {
text: '行业信息统计'
}; var xAxis = {
categories: industrys,
crosshair: true
};
var yAxis = {
min: ,
max: ,
title: {
text: '单位/个'
}
};
var tooltip = {
headerFormat: '<span style="font-size:10px">{point.key}</span><table>',
pointFormat: '<tr><td style="color:{series.color};padding:0">{series.name}:</td>' +
'<td style="padding:0"><b>{point.y}</b>/个</td></tr>',
footerFormat: '<tr><td colspan="2"><span style="font-size:12px">单击柱看详情</span></td></tr></table>',
shared: true,
useHTML: true
};
var plotOptions = {
series: {
cursor: 'pointer',
events: {
click: function (e) {
//待上报
GetnotcountList(pageIndex, pageSize, e.point.category); //待审核
getreportlist(pageIndex, pageSize, e.point.category); //即将过期
GetsooncountList(pageIndex, pageSize, e.point.category); //已过期
GetoverduecountList(pageIndex, pageSize, e.point.category);
$('#four_table').show();
}
},
}, column: {
pointPadding: 0.2,
borderWidth: , //柱子边框宽度
pointWidth: //柱子宽度
}
};
var credits = {
enabled: false
}; var series = [{ color: '#00C0EF',
name: '待上报',
data: notcounts
}, {
color: '#00A65A',
name: '待审核',
data: notauditcounts
}, {
color: '#F39C12',
name: '即将过期',
data: sooncount
}, { color: '#DD4B39',
name: '已过期',
data: overduecount
}]; var json = {};
json.chart = chart;
json.title = title;
json.tooltip = tooltip;
json.xAxis = xAxis;
json.yAxis = yAxis;
json.series = series;
json.plotOptions = plotOptions;
json.credits = credits;
$('#container').highcharts(json);
}
});
} }); }
$(function () { @{
string zt = Session["user_role_name"].ToString(); if(zt.Contains("普通用户"))
{
ViewData["Isvissable"] = "No";
}
if (zt.Contains("系统用户"))
{
ViewData["Isvissable"] = "Yes";
}
}
var Isvissable = "@ViewData["Isvissable"]";
if (Isvissable == "No") {
$("#topp").remove();
} LoadData();
GetAllNum();
}); //获得各类数据的数量(未上报 过期等)
function GetAllNum() {
var params = {};
var url = "/api/report/GetHomeCount";
ajaxPost(url, params, function (data) {
if (!data.data == null) {
layer.msg("无数据" + data.errmsg, { icon: , time: });
return;
}
$('#notcount').text(data.data.notcount);
$('#notauditcount').text(data.data.notauditcount);
$('#sooncount').text(data.data.sooncount);
$('#overduecount').text(data.data.overduecount); });
} //未上报企业信息
function GetnotcountList(pageIndex, pageSize, company_type) {
var colums = [
{
data: 'name'
},
{
data: 'address'
}, {
data: 'industry_name'
}, {
data: 'org_level_name'
}]; createTable("notcount_table", colums, function (data, callback, settings) {
var pc = ;
pageIndex = (data.start / pageSize) + ;
var params = { //这是自定义参数
pageIndex: pageIndex,
pageSize: pageSize,
OrderField: "id asc",
company_type: company_type
}; var url = "/api/company/GetNotList"; //接口地址
ajaxPost(url, params, function (rs) {
var fData = {
draw: ,
recordsTotal: ,
recordsFiltered: ,
data: []
};
if (!rs.status) {
layer.msg("请求出错,请稍后重试" + rs.errmsg, { icon: , time: });
callback(fData);
return;
}
if (rs.data == null) { callback(fData);
return;
}
var gearDatas = [];
for (var i = ; i < rs.data.length; i++) {
var datwwa = new NotcountData(rs.data[i].industry_name, rs.data[i].org_level_name, rs.data[i].name, rs.data[i].address, rs.data[i].id)
gearDatas.push(datwwa);
}
pc = rs.total;
fData.data = gearDatas;
fData.recordsTotal = pc;
fData.recordsFiltered = pc;
callback(fData);
});
}); }
function NotcountData(industry_name, org_level_name, name, address, id) {
this.id = id;
this.industry_name = industry_name;
this.org_level_name = org_level_name;
this.name = name;
this.address = address;
this.id = id;
} //已过期
function GetoverduecountList(pageIndex, pageSize, company_type) {
var colums = [{
data: 'company_name'
}, {
data: 'company_type'
},
{
data: 'create_date'
},
{
data: 'update_date'
},
{
data: 'audit_date'
},
{
data: 'audit_statusStr'
},
{
data: 'remark'
}];
createTable("overduecount_table", colums, function (data, callback, settings) {
var pc = ;
pageIndex = (data.start / pageSize) + ;
var params = { //这是自定义参数
pageIndex: pageIndex,
pageSize: pageSize,
OrderField: "id asc",
company_type: company_type
}; var url = "/api/report/GetOverdueList"; //接口地址
ajaxPost(url, params, function (rs) {
var fData = {
draw: ,
recordsTotal: ,
recordsFiltered: ,
data: []
};
if (!rs.status) {
layer.msg("请求出错,请稍后重试" + rs.errmsg, { icon: , time: });
callback(fData);
return;
}
if (rs.data == null) {
callback(fData);
return;
}
var gearDatas = [];
for (var i = ; i < rs.data.length; i++) {
var datwwa = new SooncountData(rs.data[i].company_name, rs.data[i].company_type, rs.data[i].create_date, rs.data[i].update_date, rs.data[i].audit_date, rs.data[i].audit_statusStr, rs.data[i].remark, rs.data[i].id)
gearDatas.push(datwwa);
}
pc = rs.total;
fData.data = gearDatas;
fData.recordsTotal = pc;
fData.recordsFiltered = pc;
callback(fData);
});
}); }
function OverduecountData(industry_name, org_level_name, name, address, id) {
this.id = id;
this.industry_name = industry_name;
this.org_level_name = org_level_name;
this.name = name;
this.address = address;
this.id = id;
} //即将过期
function GetsooncountList(pageIndex, pageSize, company_type) {
var colums = [{
data: 'company_name'
}, {
data: 'company_type'
},
{
data: 'create_date'
},
{
data: 'update_date'
},
{
data: 'audit_date'
},
{
data: 'audit_statusStr'
},
{
data: 'remark'
}];
createTable("sooncount_table", colums, function (data, callback, settings) {
var pc = ; pageIndex = (data.start / pageSize) + ;
var params = { //这是自定义参数
pageIndex: pageIndex,
pageSize: pageSize,
OrderField: "id asc",
company_type: company_type
};
var url = "/api/report/GetOtherList"; //接口地址 ajaxPost(url, params, function (rs) {
var fData = {
draw: ,
recordsTotal: ,
recordsFiltered: ,
data: []
};
if (!rs.status) {
layer.msg("请求出错,请稍后重试" + rs.errmsg, { icon: , time: });
callback(fData);
return;
}
if (rs.data == null) {
callback(fData);
return;
}
var gearDatas = [];
for (var i = ; i < rs.data.length; i++) {
var datwwa = new SooncountData(rs.data[i].company_name, rs.data[i].company_type, rs.data[i].create_date, rs.data[i].update_date, rs.data[i].audit_date, rs.data[i].audit_statusStr, rs.data[i].remark, rs.data[i].id)
gearDatas.push(datwwa);
}
pc = rs.total;
fData.data = gearDatas;
fData.recordsTotal = pc;
fData.recordsFiltered = pc;
callback(fData);
});
});
}
function SooncountData(company_name, company_type, create_date, update_date, audit_date, audit_statusStr, remark, id) {
this.id = id;
this.company_type = company_type;
this.company_name = company_name;
this.create_date = create_date;
this.update_date = update_date;
this.audit_date = audit_date;
this.audit_statusStr = audit_statusStr;
this.remark = remark;
this.operate = function () {
return "<button onclick='reportAddOrEdit(" + this.id + ")' class='btn btn-success btn-xs fa fa-pencil-square-o '></button>";
}
} // 待审核
function getreportlist(pageIndex, pageSize, company_type) {
var colums = [{
data: 'company_name'
}, {
data: 'company_type'
},
{
data: 'create_date'
},
{
data: 'update_date'
}, {
data: 'remark'
}];
createTable("notauditcount_table", colums, function (data, callback, settings) {
var pc = ;
pageIndex = (data.start / pageSize) + ;
var params = { //这是自定义参数
pageIndex: pageIndex,
pageSize: pageSize,
OrderField: "id asc",
company_type: company_type,
audit_status: //是否合格 0:未审核 1:审核通过 2:审核未通过 -1:全部
}; var url = "/api/report/GetList"; //接口地址
ajaxPost(url, params, function (rs) {
var fData = {
draw: ,
recordsTotal: ,
recordsFiltered: ,
data: []
};
if (!rs.status) {
layer.msg("请求出错,请稍后重试" + rs.errmsg, { icon: , time: });
callback(fData);
return;
}
if (rs.data == null) {
callback(fData);
return;
}
var gearDatas = [];
for (var i = ; i < rs.data.length; i++) {
var datwwa = new BZGLData(rs.data[i].company_name, rs.data[i].company_type, rs.data[i].create_date, rs.data[i].update_date, rs.data[i].audit_date, rs.data[i].audit_statusStr, rs.data[i].remark, rs.data[i].id)
gearDatas.push(datwwa);
}
pc = rs.total;
fData.data = gearDatas;
fData.recordsTotal = pc;
fData.recordsFiltered = pc;
callback(fData);
});
});
}
function BZGLData(company_name, company_type, create_date, update_date, audit_date, audit_statusStr, remark, id) {
this.id = id;
this.company_type = company_type;
this.company_name = company_name;
this.create_date = create_date;
this.update_date = update_date;
this.audit_date = audit_date;
this.audit_statusStr = function () {
var zt = "";
if (audit_statusStr == "审核通过") {
zt = '<span class="grid-report-item green ">' + audit_statusStr + '</span>';
}
if (audit_statusStr == "未审核") {
zt = '<span class="grid-report-item blue ">' + audit_statusStr + '</span>';
}
if (audit_statusStr == "审核不通过") {
zt = '<span class="grid-report-item yellow ">' + audit_statusStr + '</span>';
}
return zt;
};
this.remark = remark;
this.operate = function () {
return "<button onclick='reportEdtil(" + this.id + ")' class='btn btn-success btn-xs fa fa-eye '></button>";
}
} function createTable(id, colums, tCallback) {
$("#" + id).DataTable({
"ajax": function (data, callback, settings) {
tCallback(data, callback, settings);
},
"serverSide": true,
"pagingType": "full_numbers",
"pageLength": ,
"processing": true,
"destroy": true,
'columns': colums,
'paging': true,
'lengthChange': false,
'searching': false,
'ordering': false,
'autoWidth': false,
"language": {
"sProcessing": "处理中...",
"sLengthMenu": "显示 _MENU_ 项结果",
"sZeroRecords": "没有匹配结果",
"sInfo": "显示第 _START_ 至 _END_ 项结果,共 _TOTAL_ 项",
"sInfoEmpty": "显示第 0 至 0 项结果,共 0 项",
"sInfoFiltered": "(由 _MAX_ 项结果过滤)",
"sInfoPostFix": "",
"sSearch": "搜索:",
"sUrl": "",
"sEmptyTable": "表中数据为空",
"sLoadingRecords": "载入中...",
"sInfoThousands": ",",
"oPaginate": {
"sFirst": "首页",
"sPrevious": "上页",
"sNext": "下页",
"sLast": "末页"
},
"oAria": {
"sSortAscending": ": 以升序排列此列",
"sSortDescending": ": 以降序排列此列"
}
}
});
};
</script>

效果图:

highcharts之柱状图的更多相关文章

  1. 使用Highcharts实现柱状图展示

    第一步 新建页面line.html,引入HighCharts核心js文件 <script type="text/javascript" src="../../js/ ...

  2. Highcharts做柱状图怎样样每个柱子都是不同的颜色显示

    series: [{ data: [{'color':'#F6BD0F','y':11}, {'color':'#AFD8F8','y':12}, {'color':'#8BBA00','y':13} ...

  3. HighCharts之2D柱状图

    1.HighCharts之2D柱状图源码 column.html: <!DOCTYPE html> <html> <head> <meta charset=& ...

  4. HighCharts之2D柱状图、折线图的组合多轴图

    HighCharts之2D柱状图.折线图的组合多轴图 1.实例源码 SomeAxis.html: <!DOCTYPE html> <html> <head> < ...

  5. HighCharts之2D柱状图、折线图的组合双轴图

    HighCharts之2D柱状图.折线图的组合双轴图 1.实例源码 DoubleAxis.html: <!DOCTYPE html> <html> <head> & ...

  6. HighCharts之2D柱状图、折线图和饼图的组合图

    HighCharts之2D柱状图.折线图和饼图的组合图 1.实例源码 ColumnLinePie.html: <!DOCTYPE html> <html> <head&g ...

  7. 【Highcharts】 绘制饼图和漏斗图

    1.outModel类设计 设计outModel类首先研究下Highcharts中series的data数据格式,发现饼图和漏斗图都可以使用这样格式的数据 series: [{ name: 'Uniq ...

  8. highCharts图表应用-模拟心电图

    通过前两章的学习,相信大家对highcharts已经有了初步的了解.这一章将通过一个例子来模拟Highcharts如何实现经常变化的数据显示. 比如说股票的涨停.实时篮球比分以及A选手和B选手的支持率 ...

  9. Echart、Excel、highcharts、jfreechart对比

      Echart Excel highcharts jfreechart 柱状图 √ √ √ √ 条形图 √ √ √ √ 折线图 √ √ √ √ 面积图 √ √ √ √ 散点图 √ √ √ √ 气泡图 ...

随机推荐

  1. sweetalert插件的使用

    sweetalert是一个漂亮的弹窗插件,使用它可以完成各种炫酷的弹窗效果 链接:sweetalert 实例 删除演示 urls.py from django.contrib import admin ...

  2. C# RestoreDirectory

    OpenFileDialog与SaveFileDialog都有RestoreDirectory属性,这个属性默认是false,打开一 个文件后,那么系统默认目录就会指向刚才打开的文件.如果设为true ...

  3. mysql查询表达式解析

    1.mysql> SHOW COLUMNS FROM users;+----------+----------------------+------+-----+---------+------ ...

  4. mvc 导出execl

    mvc导出execl 必须是get方法才可以  也不能使用ajax function ComplaintsExport() { var serial = $("form").ser ...

  5. 微信小程序 后端用Flask实现

    手上有个微信小程序项目,因为对Python相对熟悉一些,打算后端用python写,具体采用python 轻量级的flask框架. 在做的过程中,有些问题需要考虑,记录在下边. 1. 开发的小程序后端怎 ...

  6. linux时间戳和时间格式的转化

    1.将时间戳转化为yyyy-MM-dd HH:mm:ss时间格式 date -d @时间戳(秒) 2.设置服务器时间---特别注意使用   date -s 时间

  7. 3年java工作经验必备技能

    3年工作经验的Java程序员应该具备的技能 一.Java基础 1.String类为什么是final的. 2.HashMap的源码,实现原理,底层结构. 3.反射中,Class.forName和clas ...

  8. 转:Java项目开发规范参考

    Java项目开发规范参考 - KevinLee的博客 - 博客频道 - CSDN.NEThttp://blog.csdn.net/u011383131/article/details/51227860 ...

  9. 20165234 《Java程序设计》第三周学习总结

    第三周学习总结 教材学习内容总结 第四章 编程语言的几个发展阶段: 面向机器语言 面向过程语言 面向对象语言 类 1. 类声明: class People { ... } class 动物 { ... ...

  10. pythonのsqlalchemy外键关联查询

    #!/usr/bin/env python import sqlalchemy from sqlalchemy import create_engine from sqlalchemy.ext.dec ...