<%@ page language="C#" autoeventwireup="true" inherits="ims.chart, ims.web" enableviewstatemac="false" enableEventValidation="false" %>
<!DOCTYPE html>
<html id="chart">
<head runat="server"><title></title>
    <meta http-equiv="X-UA-Compatible" content="IE=edge" /><meta name="viewport" content="width=device-width,initial-scale=1">
    <script src="js/comm.js"></script><script src="js/chart.js"></script>
</head>
<body>
    <form id="form1" runat="server">
    <asp:ScriptManager ID="sm" runat="server" OnAsyncPostBackError="AsyncError" />
    <div id="echart" style="width:100%;height:360px;margin-bottom:6px"></div>
    <asp:UpdatePanel ID="upSetting" runat="server" OnPreRender="AddInitScript" UpdateMode="Conditional">
        <ContentTemplate>
        <div class="ui-tabs">
        <ul class="ui-tabs-nav ui-helper-clearfix">
	        <li id="liTitle"><a href="#setting">图表设置</a></li>
            <li id="liChars"><asp:DropDownList runat="server" ID="ddlCharts" AutoPostBack="true" OnSelectedIndexChanged="SwitchChart" onchange="dispLoading();"></asp:DropDownList></li>
        </ul>
        <div class="tab clear" id="setting">
	        <ul id="zone1">
	            <li>图表类型： <asp:DropDownList runat="server" ID="ddlType">
                    <asp:ListItem Value="bar">柱状图</asp:ListItem>
                    <asp:ListItem Value="line">折线图</asp:ListItem>
                    <asp:ListItem Value="pie">饼图</asp:ListItem>
                    <asp:ListItem Value="funnel">漏斗图</asp:ListItem>
                    <asp:ListItem Value="scatter">散点图</asp:ListItem>
	                </asp:DropDownList></li>
	            <li title="指定按什么字段来分组统计">分组字段： <asp:DropDownList Runat="server" ID="ddlXs"></asp:DropDownList></li>
	            <li title="要统计的值字段">统计指标： <asp:DropDownList Runat="server" ID="ddlYs"></asp:DropDownList></li>
	        </ul>
	        <ul id="zone2">
	            <li>统计方法： <asp:DropDownList Runat="server" ID="ddlStatMode" Width="74">
                <asp:ListItem Value="sum">合计</asp:ListItem>
                <asp:ListItem Value="avg">平均值</asp:ListItem>
                <asp:ListItem Value="max">最大值</asp:ListItem>
                <asp:ListItem Value="min">最小值</asp:ListItem>
                <asp:ListItem Value="var">方差</asp:ListItem>
                <asp:ListItem Value="stdev">标准偏差</asp:ListItem>
                <asp:ListItem Value="count">计数</asp:ListItem>
                </asp:DropDownList></li>
	            <li id="liSeps" title="设置对数据如何分组（分组后才能统计各组的值）">分组方法： <asp:DropDownList runat="server" ID="ddlGroupby"><asp:ListItem Selected="True" Value="All">按所有值分组</asp:ListItem><asp:ListItem Value="Auto">自动分组</asp:ListItem><asp:ListItem Value="Specified">手动分组</asp:ListItem></asp:DropDownList>
                    <asp:DropDownList runat="server" ID="ddlTimeSpan"></asp:DropDownList>
                    <asp:TextBox ID="SepValues" Width="200" runat="server"></asp:TextBox></li>
	            <li title="设置数据项如何排序">排序方式： <asp:DropDownList Runat="server" ID="ddlSortMode">
                <asp:ListItem Value="">无</asp:ListItem>
                <asp:ListItem Value="ASC">升序</asp:ListItem>
                <asp:ListItem Selected="True" Value="DESC">降序</asp:ListItem>
                <asp:ListItem Value="_ASC">类目升序</asp:ListItem>
                <asp:ListItem Value="_DESC">类目降序</asp:ListItem>
                </asp:DropDownList></li>
	        </ul>
        </div>
        </div>
        </ContentTemplate>
    </asp:UpdatePanel>

        <asp:UpdatePanel ID="upBtnArea" runat="server" UpdateMode="Conditional" ChildrenAsTriggers="false" class="footBtnArea bigger">
            <ContentTemplate>
	            <asp:Button ID="btnBuild" runat="server" Text="生成图表" OnClick="Build" OnClientClick="dispLoading();" CssClass="btn" />
                <input type="button" runat="server" ID="btnSave" onclick="return toSave();" value="保存设置" onserverclick="SaveSetting" class="btn" />
	            <input type="button" runat="server" ID="btnManage" value="图表管理" onserverclick="ManageCharts" class="btn" />
                <span class="block320">
	                <input type="button" runat="server" id="btnPrint" class="btn" onclick="printPrompt();" value="打印" />
	                <input type="button" onclick="back();" value="返回" class="btn" />
                </span>
            </ContentTemplate>
        </asp:UpdatePanel>

        <ims:Pop runat="server" ID="m" ShowOkButton="false" HideOnOkClientClick="false" CanelButtonText="关闭" HelpSubject="chartManage" Title="管理图表" CustomCss="noline">
            <ContentTemplate>
                <div runat="server" id="allCharts">
                    <table class="normal center">
                        <tr><th>图表名称</th><th style="width:60px">设为默认</th><th style="width:32px">更名</th><th style="width:32px">删除</th></tr>
                        <asp:PlaceHolder runat="server" ID="phCharts"></asp:PlaceHolder>
                    </table>
                </div>
                <fieldset class="mtop_n mbottom_s"><legend>默认图表规则</legend>
                    <div class="padbox">
                        <ol runat="server" id="olRules" class="olRules"></ol>
                        <div class="right"><a href="#" id="aAddRule" onclick="return toAddRule();" runat="server" onserverclick="ToAddRule" class="u">添加规则</a></div>
                    </div>
                </fieldset>
            </ContentTemplate>
        </ims:Pop>
        <ims:Pop runat="server" ID="rule" ShowProgress="false" CustomCss="noline" OnClientUpdated="setTimeout(initRule,0);" Width="410" OnOkClick="SaveRule" HideOnOkClientClick="false">
            <ContentTemplate>
                <table class="fixedLayout">
                    <tr><td class="ruleKey">指定角色：</td><td><asp:TextBox runat="server" ID="tbRoles" TextMode="MultiLine" Rows="3" Width="99%" acfid="RoleName" chars=";；,，、" ToolTip="输入角色名。多项之间以逗号、分号或顿号分隔"></asp:TextBox></td></tr>
                    <tr><td class="ruleKey">默认图表：</td><td><asp:DropDownList runat="server" ID="ddlAll"></asp:DropDownList></td></tr>
                </table>
            </ContentTemplate>
        </ims:Pop>
    </form>
</body>
</html>
