Example #1
0
        protected void ButtonShow_Click(object sender, EventArgs e)
        {
            int[] data = { 12, 10, 131, 18, 112, 17 };
            int[] data2 = { 237, 115, 13, 8, 125, 16 };
            string[] legend = { "ich", "bin", "hier", "auch", "die", "welt" };

            GCG c = new GCG();
            DataTable dt = new DataTable();
            dt.Columns.Add(new DataColumn("Zeit", typeof(string)));
            dt.Columns.Add(new DataColumn("Wert", typeof(int)));
            foreach(int i in data2)
            {
                DataRow newR = dt.NewRow();
                newR[1] = i;
                dt.Rows.Add(newR);
            }
            c.ChartData = (dt);

            c.Width = int.Parse(TextBoxWidth.Text);
            c.Height = int.Parse(TextBoxHeight.Text);
            if (RadioButtonPie.Checked) c.ChartType = GCG.ChartTypes.Pie;
            if (RadioButtonBar.Checked) c.ChartType = GCG.ChartTypes.Bar;
            if (RadioButtonLine.Checked) c.ChartType = GCG.ChartTypes.Line;

            c.ChartTitle = TextBoxTitel.Text;

            string url = c.ImageUrl;
            ImageGoogleChart.ImageUrl = url;
            TextBoxUrl.Text = url;
        }
Example #2
0
        protected void ButtonShow_Click(object sender, EventArgs e)
        {
            int[]    data   = { 12, 10, 131, 18, 112, 17 };
            int[]    data2  = { 237, 115, 13, 8, 125, 16 };
            string[] legend = { "ich", "bin", "hier", "auch", "die", "welt" };


            GCG       c  = new GCG();
            DataTable dt = new DataTable();

            dt.Columns.Add(new DataColumn("Zeit", typeof(string)));
            dt.Columns.Add(new DataColumn("Wert", typeof(int)));
            foreach (int i in data2)
            {
                DataRow newR = dt.NewRow();
                newR[1] = i;
                dt.Rows.Add(newR);
            }
            c.ChartData = (dt);

            c.Width  = int.Parse(TextBoxWidth.Text);
            c.Height = int.Parse(TextBoxHeight.Text);
            if (RadioButtonPie.Checked)
            {
                c.ChartType = GCG.ChartTypes.Pie;
            }
            if (RadioButtonBar.Checked)
            {
                c.ChartType = GCG.ChartTypes.Bar;
            }
            if (RadioButtonLine.Checked)
            {
                c.ChartType = GCG.ChartTypes.Line;
            }


            c.ChartTitle = TextBoxTitel.Text;


            string url = c.ImageUrl;

            ImageGoogleChart.ImageUrl = url;
            TextBoxUrl.Text           = url;
        }
Example #3
0
        protected void Page_Load(object sender, EventArgs e)
        {
            // TODO - den Code aus der Testseite *DRINGEND* wieder löschen

            DataTable dataTable; // die muss gefüllt werden
            string constr = ConfigurationManager.ConnectionStrings["LotboxConnectionString"].ConnectionString;
            SqlConnection con = new SqlConnection(constr);

            string sql = "select top 20 ";
            sql += " datediff(ww, created, lastlogindate) AS AktiveWochen, ";
            sql += " count(*) AS AnzahlSpieler ";
            sql += " from playerview ";
            sql += " where SumOfPayIn > 0 and status=0 ";
            sql += " group by datediff(ww, created, lastlogindate) ";
            sql += " order by datediff(ww, created, lastlogindate) ";

            SqlCommand cmd = new SqlCommand(sql, con);
            SqlDataAdapter ad = new SqlDataAdapter(cmd);
            DataSet ds = new DataSet();
            ad.Fill(ds);
            dataTable = ds.Tables[0];

            // -- Daten sind fertig
            GridView1.DataSource = dataTable;
            GridView1.DataBind();

            GCG g = new GCG();
            g.ChartData = dataTable;
            g.ChartTitle = "erster Test";
            g.ChartType = GCG.ChartTypes.Line;

            g.Width = 300;
            g.Height = 200;

            string url = g.ImageUrl;
            Image1.ImageUrl = url;
        }