Page 1 of 1

Runtime assignment of data source and chart style.

Posted: Tue Feb 10, 2004 4:41 pm
by 8123661
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

Posted: Tue Feb 10, 2004 11:06 pm
by Pep
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.

Posted: Thu Feb 12, 2004 9:41 pm
by 8123661
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

Posted: Fri Feb 20, 2004 9:28 pm
by 8123661
It has been a week since my last post. Does anyone has examples on how to do this?

Thanks,
W

Posted: Mon Feb 23, 2004 12:13 pm
by Marc
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