天津投入产出系统后端
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

63 lines
2.5 KiB

<%@ Page Title="" Language="C#" MasterPageFile="~/Views/Shared/AppMaster.Master" Inherits="System.Web.Mvc.ViewPage<dynamic>" %>
<asp:Content ID="Content1" ContentPlaceHolderID="TitleContent" runat="server">
标准柱状图
</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
<!--图表配置-->
<%=QMAPP.Common.Web.AppConfig.QMEChartPageConfig()%>
<%--异步获取数据生成图表--%>
<%=QMFrameWork.WebUI.QMEChart.QMEChartHelper.CreateEchart("echartID", "/EChartExample/GetEchartDataBar1"
, new string[] { "line", "bar" }, "myEChart",300, QMFrameWork.WebUI.QMEChart.QMEChartHelper.echartEventEnum.click, "clickBar1Function")%>
<%--皮肤切换下拉列表--%>
<%=QMFrameWork.WebUI.QMEChart.QMEChartHelper.CreateStyleSelector("themeselectbar1", "myEChart")%>
<%--刷新按钮--%>
<%=QMFrameWork.WebUI.QMEChart.QMEChartHelper.CreateRefresh("refreshEChartbar1", "myEChart")%>
<script type="text/javascript">
function refreshEChartbar1() {
var ps = [];
var param = {};
param.key = "name";
param.value = "aaa";
ps.push(param);
GetEchartData("/EChartExample/GetEchartDataBar1", myEChart, ps);
//添加CLICK事件绑定
myEChart.on('click', function (param) { clickBar1Function(param); })
}
//点击事件
function clickBar1Function(clickData) {
var series = myEChart.getSeries();
var ps = [];
var param1 = {};
var param2 = {};
param1.key = "Cate";
param1.value = series[clickData.seriesIndex].cate;
param2.key = "SubCate";
param2.value = series[clickData.seriesIndex].subCate[clickData.dataIndex];
ps.push(param1);
ps.push(param2);
//alert(JSON.stringify(clickData));
var param3 = {};
var param4 = {};
param3.key = "CateName";
param3.value = encodeURI(clickData.seriesName);
param4.key = "SubCateName";
param4.value = encodeURI(clickData.name);
ps.push(param3);
ps.push(param4);
GetEchartData("/EChartExample/GetEchartDataSubBar1", myEChart, ps);
//解除CLICK事件绑定
myEChart.un('click');
}
</script>
</asp:Content>
<asp:Content ID="Content3" ContentPlaceHolderID="ToolContent" runat="server">
</asp:Content>