Webchart data source binding

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
jamesl
Newbie
Newbie
Posts: 10
Joined: Wed May 23, 2007 12:00 am
Contact:

Webchart data source binding

Post by jamesl » Wed Sep 26, 2007 2:09 pm

Using Visual Studio .NET 2005, how do I connect a data source to the webchart ? I can drag the webchart to the form and drag a SQLDataSource but cannot find away of binding together ie get access to datasource through Chart Editor/Series/Data Source/Database. I can do this easy enough as a Windows app but not as a web app.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Wed Sep 26, 2007 2:18 pm

Hi jamesl,

There's no design-time support for databases in WebForms. It doesn't make much sense sending a dataset to a browser. I recommend you to read this thread on how to achieve what you request.

Thanks in advance!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jamesl
Newbie
Newbie
Posts: 10
Joined: Wed May 23, 2007 12:00 am
Contact:

Post by jamesl » Wed Sep 26, 2007 2:34 pm

Hi Narcis, thanks for the reply.

I have read this thread several times now and still no clearer on finding a example on how to bind a SQL database against a chart against a webform.

Firstly, the examples that you point out are aimed towards Visual 2003 (not 2005) / Windows Forms (not webforms) and microsoft access databases (not sql server).

The Bindingsource steps only work for windows forms not webforms as we dont appear to have a 'Data' tab available!

Also, where do we gain access to the 'debug' verion appears to open up this functionality so that it is available for web forms?

You mention 'If necessary, I can also try to arrange a WebForm example in VS2005 using BindingSource for you.
' would this be more appropriate?

Any help appreciated.

James

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 27, 2007 7:55 am

Hi James,

Have you tried using the example pw posted in that thread?

Thanks in advance!
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jamesl
Newbie
Newbie
Posts: 10
Joined: Wed May 23, 2007 12:00 am
Contact:

Post by jamesl » Thu Sep 27, 2007 8:29 am

Hi Narcis, as I have stated I have looked at the thread in question but this thread points to another thread which looks at bindingsource.

So,which example are you actually referring to?

Many thanks!

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Post by Narcís » Thu Sep 27, 2007 9:22 am

Hi James,

I'm referring to the thread I already pointed you:

http://www.teechart.net/support/viewtopic.php?t=3416

If you read the whole thread, you'll see that on 6th February 2006 pw posted an example on how to achieve something similar to what you request.

Thanks in advance.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

jamesl
Newbie
Newbie
Posts: 10
Joined: Wed May 23, 2007 12:00 am
Contact:

Post by jamesl » Thu Sep 27, 2007 10:02 am

Hi Narcis, thanks for the reply we in fact did see the post but were confused by what the manual was telling us:-

'And Internet ! TeeChart Pro .Net is fully compatible with ASP.NET, being able to be placed on an ASP.NET WebForm and edited at design time in a completely WYSIWYG fashion'

Please can I confirm our current understanding, in that you cannot bind data at 'design time' and therefore cannot see what it is you are meant to be designing?

That all of the chart functionality which is easily accessible within a windows form by editing the control now needs to be dealt from within code?

However, we will pursue the posting that was made on the 6th Feb!

Many thanks!

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Post by Marc » Fri Sep 28, 2007 10:38 am

Hello,

Confirmation:
WebChart does not recognise for the Chart Editor, the SQLDataAdapter at designtime.

Current connection code would take the following form:
Eg.

Code: Select all

protected void Page_Load(object sender, EventArgs e)
{
  System.Web.UI.DataSourceSelectArguments dArgs = new DataSourceSelectArguments();
  System.Data.DataView dView =new DataView();

  //assumes SqlDataSource1 setup correctly to return data
  dView = (System.Data.DataView)(SqlDataSource1.Select(dArgs));

  WebChart1.Chart.Axes.Bottom.Labels.Angle = 90;
  WebChart1.Chart[0].YValues.DataMember = dView.Table.Columns[1].ToString(); //yvalues
  WebChart1.Chart[0].XValues.DataMember = dView.Table.Columns[2].ToString(); //xvalues
  WebChart1.Chart[0].LabelMember = dView.Table.Columns[0].ToString(); //labels
  WebChart1.Chart[0].DataSource = dView;
}
We'll put it on our prioirity list to see whether we can offer in the near future the SQLDataAdapter to the Editorlist of visible datasets.

Regards,
Marc Meumann
Steema Support

Post Reply