<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. mosh

    mosh 是一款使用 UDP 连接 C/S 的终端工具, 服务器只需安装好 mosh 套件, 并启动 SSH 服务, 等待 Client 连接即可. Client (mosh-client) 连接时, ...

  2. js对象,字符串 互相 转换

     JSON.stringify(jsonobj);    //可以将json对象转换成json字符串 反过来: JSON.parse(jsonstr);     //可以将json字符串转换成json ...

  3. Java - 网络编程完全总结

    本文主要是自己在网络编程方面的学习总结,先主要介绍计算机网络方面的相关内容,包括计算机网络基础,OSI参考模型,TCP/IP协议簇,常见的网络协议等等,在此基础上,介绍Java中的网络编程. 一.概述 ...

  4. PHP文件缓存包含三种格式

    http://developer.51cto.com/art/200912/166975.htm PHP文件缓存的速度一直是PHP程序员们关心的问题,他们一直在探讨着如何才能提高PHP文件缓存的效率来 ...

  5. MacOS安装kafka可视化工具Kafka Tool

    1 下载地址 http://www.kafkatool.com/download.html 2 下载dmg包,选择对应版本,我的kafka是2.1的版本,所以选择了Kafka Tool 2.0.4 3 ...

  6. jq的load

    1.用于监听加载是否完成 当指定的元素(及子元素)已加载时,会发生 load() 事件. 该事件适用于任何带有 URL 的元素(比如图像.脚本.框架.内联框架). 根据不同的浏览器(Firefox 和 ...

  7. day 5 - 1 字典(dict)

    dict dict key 必须是不可变数据类型,可哈希value:任意数据类型 dict 优点:使用二分查询来搜索数据存储了大量的关系型数据特点:无序的 数据类型划分:可变数据类型,不可变数据类型不 ...

  8. 【blog】Hibernate5如何设置SQLite的方言(待更新...)

    参考链接 Hibernate3.Hibernate4.Hibernate5 hibernate5连接sqlite (目前参考的是这个方法)

  9. Log4j日志根据配置输出到多个自定义文件

    最近工作中遇到所有日志需要记录到一个文件,而错误的sql执行记录到另一个文件中,查询了一些资料搞定,记录下来.顺便吐槽下公司限制印象笔记的使用. ##log4j.rootLogger=INFO, CO ...

  10. 配置Oracle GoldenGate安全性

    本章介绍如何配置Oracle GoldenGate安全性. 本章包括以下部分: Overview of Oracle GoldenGate Security Options Encrypting Da ...