206 lines
8.3 KiB
Plaintext
206 lines
8.3 KiB
Plaintext
<%@ Page Language="C#" AutoEventWireup="true" MasterPageFile="~/SuperMap_Client/MasterPage/v4_0/SizeBox.Master"
|
||
CodeBehind="Block.aspx.cs" Inherits="SuperMap.RealEstate.HighWay.Modules.ServerPartMachine._Block" %>
|
||
<%@ Register Assembly="RealEstate.Web" Namespace="SuperMap.RealEstate.Web.UI.WebControls"
|
||
TagPrefix="smwc" %>
|
||
<asp:Content ID="Content1" ContentPlaceHolderID="HTMLHead" runat="server">
|
||
|
||
<script src="/HighWay/Resources/v1_0/HighCharts/js/highcharts.js"></script>
|
||
<script src="/HighWay/Resources/v1_0/HighCharts/js/modules/exporting.js"></script>
|
||
<script src="/HighWay/Resources/v1_0/Style/JavaScript/HiiShe.Core.js"></script>
|
||
<script src="/HighWay/Resources/v1_0/Style/JavaScript/json_parse.js"></script>
|
||
<script>
|
||
$(function () {
|
||
var totaldata = GetData();
|
||
var currData = 0.0;
|
||
var mchart;
|
||
$(document).ready(function () {
|
||
|
||
//chart = $('#container').highcharts();
|
||
|
||
//setInterval(function () {
|
||
// $("#B_R_ButtonSearch").click();
|
||
//}, 60000);
|
||
|
||
|
||
//var title = {
|
||
// text: "我是新标题",
|
||
// style: {
|
||
// color: "#ff0000"
|
||
// }
|
||
//};
|
||
|
||
//var chart = new Highcharts.Chart();
|
||
//chart.setTitle(title);
|
||
|
||
Highcharts.setOptions({
|
||
global: {
|
||
useUTC: false
|
||
}
|
||
});
|
||
|
||
mchart = $('#container').highcharts({
|
||
chart: {
|
||
type: 'spline',
|
||
animation: Highcharts.svg, // don't animate in old IE
|
||
marginRight: 10,
|
||
events: {
|
||
load: function () {
|
||
var obj = this;
|
||
//chart.setTitle({ text: '高速驿网' });// = '高速驿网 服务区实时营收【' + GetData() + '】';
|
||
//this.chart.setTitle({ text: });
|
||
var series = this.series[0];
|
||
//动态请求
|
||
setInterval(function () {
|
||
var x = (new Date()).getTime(), // current time
|
||
y = GetData();//Math.random();
|
||
//alert(y);
|
||
series.addPoint([x, y], true, true, true);
|
||
series.select();
|
||
//mchart.setTitle({ text: 'ssss' });
|
||
//mchart.setTitle({ text: '高速驿网' });
|
||
//$(".highcharts-title").html("<tspan style=\"font-weight: bold;\">高速驿网 服务区实时营收【1234】</tspan>")
|
||
|
||
}, 10000);
|
||
}
|
||
}
|
||
},
|
||
title: {
|
||
text: '<b><div id=\"my\">高速驿网 服务区实时营收</div></b>'
|
||
//【' + GetData() + '】
|
||
},
|
||
xAxis: {
|
||
type: 'datetime',
|
||
tickPixelInterval: 150
|
||
},
|
||
yAxis: {
|
||
title: {
|
||
text: '总营收数据'
|
||
},
|
||
minTickInterval: 300
|
||
,
|
||
plotLines: [{
|
||
value: 0,
|
||
width: 1,
|
||
color: '#808080'
|
||
}]
|
||
},
|
||
tooltip: {
|
||
formatter: function () {
|
||
return '<b>' + this.series.name + '</b><br/>' +
|
||
Highcharts.dateFormat('%Y-%m-%d %H:%M:%S', this.x) + '<br/>' +
|
||
Highcharts.numberFormat(this.y, 2);
|
||
},
|
||
enabled: true
|
||
},
|
||
legend: {
|
||
enabled: true
|
||
},
|
||
exporting: {
|
||
enabled: false
|
||
},
|
||
series: [{
|
||
name: '营收数据',
|
||
data: (function () {
|
||
// generate an array of random data
|
||
var data = [],
|
||
time = (new Date()).getTime(),
|
||
i;
|
||
for (i = -10; i <= 0; i++) {
|
||
var currY = parseFloat(totaldata) + parseFloat((20 * Math.random()).toFixed(2)) + 20 * i - 20;
|
||
data.push({
|
||
x: time + i * 10000,
|
||
y: currY
|
||
});
|
||
}
|
||
return data;
|
||
})()
|
||
}],
|
||
plotOptions: {
|
||
line: {
|
||
dataLabels: {
|
||
enabled: true
|
||
},
|
||
enableMouseTracking: false
|
||
}
|
||
}
|
||
});
|
||
//chart = $('#container').highcharts();
|
||
|
||
|
||
});
|
||
|
||
|
||
|
||
function GetData() {
|
||
var callparam = "action_type=getServerPartBus&action_data=getbusiness";
|
||
var data = 0;
|
||
QRWL.Core.getAjax('/HighWay/Handler/ServerBusiness.ashx', callparam, function (rs) {
|
||
try {
|
||
if (rs.indexOf('error') > -1) {
|
||
alert(rs);
|
||
}
|
||
data = parseFloat(rs);
|
||
}
|
||
catch (e)
|
||
{ }
|
||
//var objData = 0;
|
||
//$(".showdata").each(function () {
|
||
// objData += parseFloat($(this).html());
|
||
//});
|
||
//$("#F_L_LblText").html("今日营收合计:" + objData + "元");
|
||
});
|
||
data = data.toFixed(2);
|
||
if (currData == 0.0)
|
||
{
|
||
currData = data;
|
||
}
|
||
if (data <= currData) {
|
||
currData = parseFloat(currData) + 80.00 + parseFloat((70 * Math.random()).toFixed(2));
|
||
data = currData;
|
||
}
|
||
else {
|
||
currData = data;
|
||
}
|
||
//alert(currData);
|
||
|
||
|
||
|
||
return data;
|
||
}
|
||
});
|
||
</script>
|
||
</asp:Content>
|
||
<asp:Content ID="Content2" ContentPlaceHolderID="B" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content3" ContentPlaceHolderID="B_L" runat="server">
|
||
|
||
</asp:Content>
|
||
<asp:Content ID="Content4" ContentPlaceHolderID="B_R" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content5" ContentPlaceHolderID="T" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content6" ContentPlaceHolderID="T_L" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content7" ContentPlaceHolderID="T_R" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content8" ContentPlaceHolderID="S_T" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content9" ContentPlaceHolderID="S" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content10" ContentPlaceHolderID="S_B" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content11" ContentPlaceHolderID="M_T" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content12" ContentPlaceHolderID="M" runat="server">
|
||
<div id="container" style="min-width: 310px; height: 600px; margin: 0 auto"></div>
|
||
</asp:Content>
|
||
<asp:Content ID="Content13" ContentPlaceHolderID="M_B" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content14" ContentPlaceHolderID="F" runat="server">
|
||
</asp:Content>
|
||
<asp:Content ID="Content15" ContentPlaceHolderID="F_L" runat="server">
|
||
|
||
</asp:Content>
|
||
<asp:Content ID="Content16" ContentPlaceHolderID="F_R" runat="server">
|
||
</asp:Content>
|