var MultiTimeChartAttrs = {
reqUrl: 'ListVisitChar',
reqData: "",
chartId: 'multiTimeChartId',
chartDivId: 'multiTimeChart',
chartUri: './../Content/charts/data/MSStackedColumn2DLineDY.swf',
chartInfo: '暂无系统访问量数据',
'900',
height: '450',
isDebug: '0',
isRegister: '0',
isLoaded: false
}
/*获取需要传递到服务器的参数*/
function getParams() {
var params = { startDate: '', endDate: '', timeTypeSelect: '' };
params.startDate = $("#startDate").val();
params.endDate = $("#endDate").val();
params.timeTypeSelect = $("#timeTypeSelect").val();
return params;
}
function query() {
var params = getParams();
MultiTimeChartAttrs.reqData = "startDate=" + params.startDate + "&endDate=" + params.endDate + "&timeTypeSelect=" + params.timeTypeSelect ;
queryChartData(MultiTimeChartAttrs);
}
/*定义统一的图表数据请求方法*/
function queryChartData(chartAttr) {
$("#" + chartAttr.chartDivId).hide().next().show();
$.ajax({
url: chartAttr.reqUrl,
data: chartAttr.reqData,
type: "POST",
dataType: "text",
success: function(jdata, stat) {
if (jdata.toString() == "") {
jdata = "<chart></chart>";
}
$("#" + chartAttr.chartDivId).show().next().hide();
var chart = new FusionCharts(chartAttr.chartUri + "?ChartNoDataText=" + chartAttr.chartInfo, chartAttr.chartId, chartAttr.width, chartAttr.height, chartAttr.isDebug,
chartAttr.isRegister);
chart.setTransparent(true);//此项会影响IE7中右键功能
chart.setDataXML(jdata.toString());
chart.render(chartAttr.chartDivId);
}
});
}