hi beautiful people ,
i want to display real chart time , binded with Mysql databse .
Axe x shows the speed (int ) and Y shows DATETIME .
my databse get updated every second
my load graph function is :
- public void load_graph()
- {
-
- MySql.Data.MySqlClient.MySqlCommand cmd = new MySql.Data.MySqlClient.MySqlCommand("select * from val_api", conn);
- MySql.Data.MySqlClient.MySqlDataReader reader;
- try
- {
- conn.Open();
- reader = cmd.ExecuteReader();
- while (reader.Read())
- {
- this.chart1.Series["Vitesse"].Points.AddXY(reader.GetInt16("vitesse"), reader.GetDateTime("dateV"));
- this.chart1.Update();
-
-
- }
- }
- catch (Exception ex)
- {
- MessageBox.Show(this, ex.Message);
- }
- conn.Close();
- }
i tried using this fuction with timer , but it doesn't work , a line shows up and than my app stops without throwing any exception .
can you please help