Runtime assignment of data source and chart style.

TeeChart for Microsoft Visual Studio .NET, Xamarin Studio (Android, iOS & Forms) & Monodevelop.
Post Reply
wcedeno
Newbie
Newbie
Posts: 6
Joined: Thu Jan 29, 2004 5:00 am
Location: PA

Runtime assignment of data source and chart style.

Post by wcedeno » Tue Feb 10, 2004 4:41 pm

I would like to use the Editor to allow the user to select the chart style, add one or more series, and setup other chart parameters at runtime. How can we do this? The data used by all series in the chart will be provided by a DataTable or DataSet containing the data. Any samples for doing this?

Thanks,
W

Pep
Site Admin
Site Admin
Posts: 3303
Joined: Fri Nov 14, 2003 5:00 am
Contact:

Post by Pep » Tue Feb 10, 2004 11:06 pm

Hi,
I would like to use the Editor to allow the user to select the chart style, add one or more series, and setup other chart parameters at runtime. How can we do this?
You can use the following line to show the Editor at runtime :
tChart1.ShowEditor();
The data used by all series in the chart will be provided by a DataTable or DataSet containing the data. Any samples for doing this?
Please see “Tutorial8 – ADO.NET Database Access” for some runtime examples.

wcedeno
Newbie
Newbie
Posts: 6
Joined: Thu Jan 29, 2004 5:00 am
Location: PA

Post by wcedeno » Thu Feb 12, 2004 9:41 pm

Thank you Pep, but the example assumes that the application knows the type of chart/series the user needs and the columns that will be used for the series.

Let me clarify my scenario. In my application, the user queries the database for some information. The information retrieved is returned in a DataTable or a DataSet. The table or columns retrieved are only known after the data is retrieved. At this point, the user decides to create a chart for the data returned. The application provides an empty chart and allows the user to open the chart editor. The user now should be able to use the chart editor to add series and assign the XY columns from the data.

I would like to attach the retrieved DataSet or DataTable to the chart or editor such that the user could select the table and XY columns. I have not found an example or documentation that will allow the chart editor to display the table information to the user.

Could you provide an example on how to do this?

Thanks for your help,
W

wcedeno
Newbie
Newbie
Posts: 6
Joined: Thu Jan 29, 2004 5:00 am
Location: PA

Post by wcedeno » Fri Feb 20, 2004 9:28 pm

It has been a week since my last post. Does anyone has examples on how to do this?

Thanks,
W

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

Post by Marc » Mon Feb 23, 2004 12:13 pm

Hello W,

The Chart Editor 'Series':'Datasource' tab will open with the Dataset fields selected if you predefine the fileds before opening the Editor. If not the person using the editor needs to go to the Series Datasource tab and select the fields they wish to display.

To make this easier you could pre-define a Series type and the display-fields at codetime when the Dataset is selected based on the number and types of fields returned. That will give a 'best estimate' choice to the user to ease their further configuration.

If the Chart Editor offers too much complexity for the selection you wish to offer you could build your own Editor.

A review of coding options for Datasets are included in the TeeChart demo under: 'All features':'Datasets'.

Regards,
Marc Meumann
Steema Support

Post Reply