Page 1 of 1

TeeCommander

Posted: Mon Nov 26, 2007 12:01 pm
by 10047047
Hi,

I am using TeeChart Pro 8.0 for C++ Builder 2007. I have added a TeeCommander to a form with a TChart.

When I open the Chart editor by clicking the Edit button in runtime, the chart editor only shows two export format (as Bitmap and as Metafile). Also there is no Themes tab. What could I do to include the full list of the export formats and the Themes tab in the chart editor.

Two more questions:
1. I add a data series for the curve fitting function. It works fine when I do not use datetime format for the horizontal axis. But the curve fitting series does not display after datetime format (hh:mm:ss) is selected although the origial data series is displayed correctly in the datetime format.

2. TColorBandTool->StartValue gives the start value of the band in double (i.e XValue). How can I convert to the index value?

Thanks in advance.

Regards

Posted: Mon Nov 26, 2007 1:59 pm
by narcis
Hi Xia,
When I open the Chart editor by clicking the Edit button in runtime, the chart editor only shows two export format (as Bitmap and as Metafile). Also there is no Themes tab. What could I do to include the full list of the export formats and the Themes tab in the chart editor.
For the export formats please read this thread. Regarding the themes tab, by default themes tab is visible as you can see in the new feature demo available at TeeChart's program group. Are you explicitly hiding it?
1. I add a data series for the curve fitting function. It works fine when I do not use datetime format for the horizontal axis. But the curve fitting series does not display after datetime format (hh:mm:ss) is selected although the origial data series is displayed correctly in the datetime format.
It works fine for me here. Could you please send us a simple example project we can run "as-is" to reproduce the problem here? You can either post your files at news://www.steema.net/steema.public.attachments newsgroup or at our upload page.
2. TColorBandTool->StartValue gives the start value of the band in double (i.e XValue). How can I convert to the index value?
Yes, you can do something like this:

Code: Select all

ChartTool1->StartValue=Series1->XValues[SeriesIndex];

Posted: Mon Nov 26, 2007 4:31 pm
by 10047047
Hi Narcis,

Thanks for your speedy reply.

1. I have added unit files for other formats, but it still shows two formats only. I did not set the themes tab. I have uploaded a zipped example project. You can repeat the problem when clicking the Edit button in the TeeCommander tool bar.

2. See uploaded the example project.

3. I may not explain clearly. I am using the datetime format for the horizontal axis. I got the XValue for time in the type double from the ChartTool->StartValue and I want to know the corresponding index number from the XValue (StartValue).

Thanks.

Posted: Tue Nov 27, 2007 10:07 am
by narcis
Hi Xia,

Thanks for the example project.

Please find below the answers to your questions:

1. This is because you need to add the unit in the includes section in the form's header file (.h). In the .cpp file you need to add it at as a pragma link. I'll send your project modified with TeeJPEG as an example.

Regarding the themes tab, sorry I forgot that you need to include TeeThemeEditor unit. I've also added it in your example.


2. I've also modified your project to work fine with Curve Fitting function. Basically you needed to provide correct DateTime values and call function's series CheckDataSource method after populating the source series.


3. You need to do something as the code below. I've also added this in your project.

Code: Select all

	ChartTool1->StartValue = Series1->XValues->Value[0];
	ChartTool1->EndValue = Series1->XValues->Value[Series1->Count()-1];

Posted: Tue Nov 27, 2007 12:17 pm
by 10047047
Hi Narcis,

Thanks for your help.

1. TeeCommander for export and Theme works fine. Thanks.

2. I need to set date as well as time using EncodeDateTime. However, it always fits in a straight line even with poly degree of 10.

3. I can set the start and end values of the color band for the entire series as you suggested. If the start and end of the color band are dragged to different positions, how to calculate the index numbers for the startvalue and endvalue and the total number of data points within the color band?

Regards

Xia

Posted: Tue Nov 27, 2007 12:53 pm
by narcis
Hi Xia,

1. You're welcome. I'm glad to hear that.

2. This is because your first point in the series has x value set to zero and the second and following points is a much higher value therefore the chart seems to be a straight line. I've modified your project and I'm going to send it.

3. The easiest way would be using tool's events like this:

Code: Select all

void __fastcall TForm1::ChartTool1Resized(TObject *Sender)
{
	Chart1->Axes->Bottom->SetMinMax(ChartTool1->StartValue, ChartTool1->EndValue);
	Chart1->Draw();

	Chart1->Title->Text->Clear();
	Chart1->Title->Text->Add("Visible points: " + IntToStr(Series1->VisibleCount()));

	Chart1->Axes->Bottom->Automatic=true;
}