绑定RadHtmlChart不起作用 [英] Binding RadHtmlChart Not work

查看:86
本文介绍了绑定RadHtmlChart不起作用的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述





我正在使用控制RadHtmlChart我以编程方式绑定它



这是我的代码的一部分和图片中的数据不显示我不知道为什么PLZ帮助我我使用gridview确保我有数据表中的数据,它的工作原理







string req =从QTSW_DATA1选择time_tag,[ain_sebou | niveau]其中time_tag在'15 / 01/2015 10:49:59'AND之间'15 / 02/2015 10:49:59';

连接器();

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 = AIn Sebou的价值;



//这里我绑定Gridview



Gridview1.DataSource = DS.Tables [TRChart] ;

Gridview1.DataBind();



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



plzz我需要帮助



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

推荐答案

我认为问题是你在调用DataBind后将系列添加到图表中。请尝试执行以下操作:

I believe the issue is that you're adding the series to the chart after you've called DataBind. Try doing the following instead:
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();


这篇关于绑定RadHtmlChart不起作用的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆