TXT

charcontro

By Raymond Robinson,2014-09-10 20:55
6 views 0
tpfancontro in contro losecontro take over contro jbl contro128 touch contro package contro self contro model view contro power contro

charcontrol×Ô??Éú?ÉÍ??ÆÍ?ÐÎ

    2009-08-27 17:46 72ÈËÔÄ?Á ÆÀÂÛ(0) ÊÕ?Ø ?Ù??

view plain

    private void simpleButton2_Click(object sender, EventArgs e)

    {

     int Total = 0;

     chartControl1.Series.Clear();

     Series series1 = new Series("ÈÕÖ?Í??Æ", ViewType.RadarArea);

     series1.PointOptions.PointView = PointView.ArgumentAndValues;

     chartControl1.Series.Add(series1);

     DataSet dataSet = new DataSet();

     string strSql = string.Format("select top 5 LXMC,AKJF from T_ql");

     DataTable tableMain = Bind(strSql);

     tableMain.TableName = "Ö??í";

     dataSet.Tables.Add(tableMain);

     foreach (DataRow row in tableMain.Rows)

     {

     if (row["LXMC"] != null)

     {

     SeriesPoint point = new

    SeriesPoint(row["LXMC"].ToString());

     double[] vals = { Convert.ToDouble(row["AKJF"]) };

     point.Values = vals;

     series1.Points.Add(point);

     Total += int.Parse(row["AKJF"].ToString());

     }

     }

    }

using System;

    using System.Collections.Generic;

    using System.ComponentModel;

    using System.Data;

    using System.Drawing;

    using System.Text;

    using System.Windows.Forms;

    using DevExpress.Skins;

using DevExpress.LookAndFeel;

using System.Data.SqlClient;

using DevExpress.XtraCharts;

namespace WindowsFormsApplication4

    {

     public partial class Form1 : Form

     {

     public Form1()

     {

     InitializeComponent();

     }

     private void Form1_Load(object sender, EventArgs e)

     {

     string sqlcon =

    "server=.;database=StockBank;uid=sa;pwd=123";

     SqlConnection con = new SqlConnection(sqlcon);

     string sqlStr = "select top 30 * from tb_view";

     con.Open();

     SqlDataAdapter adapter = new SqlDataAdapter(sqlStr, con);

     DataSet ds = new DataSet();

     adapter.Fill(ds, "id");

     if (ds.Tables["id"].Rows.Count != 0)

     {

     for (int j = 0; j < ds.Tables["id"].Rows.Count; j++)

     {

     if (ds.Tables["id"].Rows[j]["sz"].ToString() != "")

     {

     string aa =

    ds.Tables["id"].Rows[j]["id"].ToString();

     string bb =

    ds.Tables["id"].Rows[j]["sz"].ToString();

    //rowsºóÃæµÄÊǵÚ??ÐеÚ??ÁеÄÊý?Ý.

     // labelControl1.Text = aa;

     string cc =

    ds.Tables["id"].Rows[j]["iofdate"].ToString();

     string dd =

    ds.Tables["id"].Rows[j]["zb"].ToString();

     int Total = 0;

     chartControl1.Series.Clear();

     Series series1 = new Series("Í??Æ", ViewType.Line);

     //ViewType.Line ViewType.RadarArea

     series1.PointOptions.PointView = PointView.ArgumentAndValues;

     chartControl1.Series.Add(series1);

     foreach (DataRow dr in ds.Tables[0].Rows)

     {

     SeriesPoint point = new SeriesPoint(dr["iofdate"].ToString());

     double[] vals =

    { Convert.ToDouble(dr["sz"]) };

     point.Values = vals;

     series1.Points.Add(point);

     }

     }

     }

     }

     }

     }

    }

Report this document

For any questions or suggestions please email
cust-service@docsford.com