Default2.aspx.cs
资源名称:vmlTest.rar [点击查看]
上传用户:yinyuehua
上传日期:2022-08-10
资源大小:17k
文件大小:7k
源码类别:
matlab例程
开发平台:
C#
- using System;
- using System.Data;
- using System.Configuration;
- using System.Collections;
- using System.Web;
- using System.Web.Security;
- using System.Web.UI;
- using System.Web.UI.WebControls;
- using System.Web.UI.WebControls.WebParts;
- using System.Web.UI.HtmlControls;
- using Microsoft.VisualBasic;
- using System.Collections.Generic;
- public partial class Default2 : System.Web.UI.Page
- {
- protected void Page_Load(object sender, EventArgs e)
- {
- if (!IsPostBack)
- {
- ViewState["ChartType"] = "Z";
- ViewState["Width"] = "550";
- ViewState["HeightSplit"] = "10";
- ViewState["Thickness"] = "20";
- ViewState["ChartWidth"] = "20";
- ViewState["VML"] = "";
- this.Bind();
- Initi(ViewState["ChartType"].ToString(),
- Convert.ToInt32(ViewState["Width"].ToString()),
- Convert.ToInt32(ViewState["HeightSplit"].ToString()),
- Convert.ToInt32(ViewState["Thickness"].ToString()),
- Convert.ToInt32(ViewState["ChartWidth"].ToString()));
- }
- }
- private void Bind()
- {
- this.Labelconvert.Text = "10000";
- this.Labelmoney.Text = "39392";
- this.Labelbank.Text ="34324";
- this.Labelchoushui.Text = "34232";
- this.Labelall.Text ="34324";
- }
- private void Initi(string ChartType, int Width, int HeightSplit, int Thickness, int ChartWidth)
- {
- string title = "统计报表";
- object[,] total = new object[6, 3]; //三维数组 1:链接地址;2
- List<string> listval = new List<string>();
- total[0, 0] = "0,";
- total[1, 0] = "玩家兑换总值,List.aspx"; //
- total[2, 0] = "抽水总值,List.aspx";
- total[3, 0] = "玩家游戏币总值,List.aspx";
- total[4, 0] = "银行总值,List.aspx";
- total[5, 0] = "充值总记录,List.aspx";
- listval.Add((Convert.ToDouble(this.Labelconvert.Text)).ToString());
- listval.Add((Convert.ToDouble(this.Labelchoushui.Text)).ToString());
- listval.Add((Convert.ToDouble(this.Labelmoney.Text)).ToString());
- listval.Add((Convert.ToDouble(this.Labelbank.Text)).ToString());
- listval.Add((Convert.ToDouble(this.Labelall.Text)).ToString());
- total[1, 1] = listval[0].ToString();
- total[2, 1] = listval[1].ToString();
- total[3, 1] = listval[2].ToString();
- total[4, 1] = listval[3].ToString();
- total[5, 1] = listval[4].ToString();
- ViewState["VML"] = ChartPic(title, total, ChartType, Width, HeightSplit, Thickness, ChartWidth);
- }
- private string ChartPic(string title, object[,] total, string ChartType, int Width, int HeightSplit, int Thickness, int ChartWidth)
- {
- ChartModule Chart = new ChartModule();
- Chart.sys_chart_title = "<b>VML统计图</b>";
- Chart.sys_chart_left = 90;
- Chart.sys_chart_top = 200;
- Chart.sys_all_width = 550;
- Chart.sys_all_height = 330;
- Chart.sys_height_split = 10;
- Chart.sys_thickness = 20;
- Chart.sys_chart_width = 20;
- Chart.sys_split_color = "#69f";
- Chart.sys_chart_backcolor = "#9cf";
- Chart.sys_chart_type = "Y";
- Chart.sys_color_list = "#FF1919,#FFFF19,#1919FF,#19FF19,#FC0,#3CC,#FF19FF,#993300,#F60,#FF8C19,#AAAAAA,#333333";
- Chart.VMLStyle = "style='position:absolute;left:0;text-align:left;top:0;flip:y;z-index:-1'";
- Chart.CHART_title = "<b>" + title + "<b>";//图表标题
- Chart.YTitle = "金额";
- Chart.XTitle = "类别";
- Chart.UNIT = "元";//单位
- Chart.CHART_left = 90;//居左
- Chart.CHART_top = 200;//居顶
- Chart.ALL_width = Width;//图表宽度
- Chart.All_height = 330;//图表高度
- Chart.HEIGHT_split = HeightSplit;//隔线条数,饼的厚度
- Chart.THICKNESS = Thickness;//柱子厚度,X 旋转角
- Chart.CHART_width = ChartWidth;//柱子宽度,交错
- Chart.SPLIT_color = "#69f";//隔线颜色
- Chart.CHART_backcolor = "#9cf";//底板颜色
- Chart.CHART_type = ChartType;//图表类型 'X 柱子横向 Y 柱子纵向 Z 饼图 L 折线图
- Chart.TOTAL = total;
- ChartBLL obj = new ChartBLL();
- return obj.csiVMLChart(Chart).ToString();
- }
- protected void btn_Column_ServerClick(object sender, EventArgs e)
- {
- ViewState["ChartType"] = "Y";
- ViewState["Width"] = "550";
- ViewState["HeightSplit"] = "10";
- ViewState["Thickness"] = "20";
- ViewState["ChartWidth"] = "20";
- Initi(ViewState["ChartType"].ToString(),
- Convert.ToInt32(ViewState["Width"].ToString()),
- Convert.ToInt32(ViewState["HeightSplit"].ToString()),
- Convert.ToInt32(ViewState["Thickness"].ToString()),
- Convert.ToInt32(ViewState["ChartWidth"].ToString()));
- }
- protected void btn_Line_ServerClick(object sender, EventArgs e)
- {
- ViewState["ChartType"] = "L";
- ViewState["Width"] = "550";
- ViewState["HeightSplit"] = "10";
- ViewState["Thickness"] = "60";
- ViewState["ChartWidth"] = "0";
- Initi(ViewState["ChartType"].ToString(),
- Convert.ToInt32(ViewState["Width"].ToString()),
- Convert.ToInt32(ViewState["HeightSplit"].ToString()),
- Convert.ToInt32(ViewState["Thickness"].ToString()),
- Convert.ToInt32(ViewState["ChartWidth"].ToString()));
- }
- protected void btn_Cake_ServerClick(object sender, EventArgs e)
- {
- ViewState["ChartType"] = "Z";
- ViewState["Width"] = "550";
- ViewState["HeightSplit"] = "15";
- ViewState["Thickness"] = "60";
- ViewState["ChartWidth"] = "0";
- Initi(ViewState["ChartType"].ToString(),
- Convert.ToInt32(ViewState["Width"].ToString()),
- Convert.ToInt32(ViewState["HeightSplit"].ToString()),
- Convert.ToInt32(ViewState["Thickness"].ToString()),
- Convert.ToInt32(ViewState["ChartWidth"].ToString()));
- }
- protected void SelectWidth_SelectedIndexChanged(object sender, EventArgs e)
- {
- ViewState["Width"] = this.SelectWidth.SelectedValue;
- Initi(ViewState["ChartType"].ToString(),
- Convert.ToInt32(ViewState["Width"].ToString()),
- Convert.ToInt32(ViewState["HeightSplit"].ToString()),
- Convert.ToInt32(ViewState["Thickness"].ToString()),
- Convert.ToInt32(ViewState["ChartWidth"].ToString()));
- }
- }