Click here to Skip to main content
15,881,172 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i'm using control RadHtmlChart wich i bind it programaticly

this is part of my code and in the pic the data don't display i dont know why plz help me i'm using gridview to make sure if i have data in datatable and it works



string req = " select time_tag,[ain_sebou|niveau] from QTSW_DATA1 where time_tag between '15/01/2015 10:49:59' AND '15/02/2015 10:49:59'";
Connecter();
if (DS.Tables.Contains("TRChart"))
{
DS.Tables.Remove("TRChart");
}
SqlDataAdapter da = new SqlDataAdapter(req, con);
da.Fill(DS, "TRChart");
Deconnecter();
RChart.DataSource = DS.Tables["TRChart"];
RChart.DataBind();

ScatterLineSeries SL = new ScatterLineSeries();
SL.DataFieldX = "time_tag";
SL.DataFieldY = "ain_sebou|niveau";
RChart.PlotArea.Series.Add(SL);
RChart.PlotArea.XAxis.TitleAppearance.Text = "Date Time";
RChart.PlotArea.YAxis.TitleAppearance.Text = "Value Of AIn Sebou";

// here i bind Gridview

Gridview1.DataSource = DS.Tables["TRChart"];
Gridview1.DataBind();

http://www.mediafire.com/view/yavzc9gza1vll1d/Graphe.JPG[^]

plzz i need help
Posted

1 solution

I believe the issue is that you're adding the series to the chart after you've called DataBind. Try doing the following instead:
C#
Deconnecter();

ScatterLineSeries SL = new ScatterLineSeries();
SL.DataFieldX = "time_tag";
SL.DataFieldY = "ain_sebou|niveau";
RChart.PlotArea.Series.Add(SL);
RChart.PlotArea.XAxis.TitleAppearance.Text = "Date Time";
RChart.PlotArea.YAxis.TitleAppearance.Text = "Value Of AIn Sebou"; 

RChart.DataSource = DS.Tables["TRChart"];
RChart.DataBind();
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900