|
板凳
楼主 |
发表于 2018-4-19 12:32:44
|
只看该作者
本帖最后由 yc2018nian 于 2018-4-19 12:36 编辑
<%@ Page Language="C#" AutoEventWireup="true" CodeBehind="FaultByDay.aspx.cs" Inherits="NanCheRailWayWeb.Web_DataManage.FaultByDay" %>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head id="Head1" runat="server">
<title></title>
<script src="../js/lockscreen.js" type="text/javascript"></script>
<script src="../js/jquery-1.4.2.min.js" type="text/javascript"></script>
<script src="../js/chart/highcharts.js" type="text/javascript"></script>
<script src="../js/chart/exporting.js" type="text/javascript"></script>
<script src="../js/chart/dark-green.js" type="text/javascript"></script>
<script src="../js/echarts-all.js" type="text/javascript"></script>
</head>
<body>
<form id="form1" runat="server">
<div>
<ext: PageManager ID=" PageManager1" runat="server" AutoSizePanelID="Toolbar" />
<ext:Toolbar ID="Toolbar" runat="server">
<Items>
<ext: Label ID="Label5" runat="server" Label="Label" Text="开始时间:">
</ext: Label>
<ext: DatePicker ID="dpStartDate" runat="server" Label="Label" EnableDateSelect="true">
</ext: DatePicker>
<ext: Label ID="Label6" runat="server" Label="Label" Text="结束时间:">
</ext: Label>
<ext: DatePicker ID="dpEndDate" runat="server" Label="Label" EnableDateSelect="true">
</ext: DatePicker>
<ext: Label ID="Label1" runat="server" Label="Label" Text="车型:">
</ext: Label>
<ext: DropDownList runat="server" ID="ddlTrainModel" Label="车型" Width="100px" AutoPostBack="True"
OnSelectedIndexChanged="ddlTrainModel_SelectedIndexChanged">
</ext: DropDownList>
<ext: Label ID="Label7" runat="server" Label="Label" Text="生产形式:">
</ext: Label>
<ext: DropDownList runat="server" ID="ddlProduction" Label="生产形式" AutoPostBack="true"
Width="100px" OnSelectedIndexChanged="ddlProduction_SelectedIndexChanged">
</ext: DropDownList>
<ext: Button ID="btnSearch" runat="server" Text="查询" IconUrl="../images/03.png"
EnablePostBack="false" CssStyle="background:url(../images/search.jpg) no-repeat">
</ext:Button>
<ext:Button ID="btnExport" Text="导出Excel" ValidateForms="extForm1" runat="server"
Icon="SystemSaveNew" EnableAjax="false" DisableControlBeforePostBack="false">
</ext:Button>
<ext: TextBox ID="testText" runat="server" Label="Label" Text="测试:">
</ext: TextBox>
</Items>
</ext:Toolbar>
<div id="faultDiv" style="width: 95%; margin: 0 auto; height: 600px;"></div>
</div>
</form>
</body>
</html>
<script type="text/javascript">
var faultDiv;
function Fault() {
faultDiv = echarts.init(document.getElementById('faultDiv'));
var faultOption = {
title: {
text: '按天统计故障数量'
},
tooltip: {
show: true,
trigger: 'item'
},
legend: {
show: true,
data: ['故障数量'],
padding: 15
},
dataZoom: {
show: true,
realtime: true,
start: 0,
end: 20
},
xAxis: [{
type: 'category',
name:'日期',
data: [" "]
}],
yAxis: [{
type: 'value',
name:'故障数量'
}],
series: [{
name: '故障数量',
type: 'line',
itemStyle: {normal: {color:'#9BCA63'}},
data: [" "],
markLine:{
data:[{
type: 'average',name:'平均值'
}]
}
}]
};
faultDiv.setOption(faultOption);
SetFaultData();
}
function SetFaultData() {
var riqi = [<%=GetFaultdataX()%>];
var num = [<%=GetFaultdataY()%>];
var options = faultDiv.getOption();
options.xAxis[0].data= riqi;
options.series[0].data= num;
faultDiv.setOption(options);
faultDiv.refresh();
}
$(function () {
var text1 = '<%=testText.ClientID %>'
var trainModel = Ext.getCmp(text1).getValue();
alert(trainModel);
Fault();
})
</script> |
|