TSeriesBandTool with C++Builder 10.1

TeeChart VCL for Borland/CodeGear/Embarcadero RAD Studio, Delphi and C++ Builder.
Post Reply
nh128
Newbie
Newbie
Posts: 6
Joined: Mon Feb 23, 2009 12:00 am

TSeriesBandTool with C++Builder 10.1

Post by nh128 » Tue Sep 11, 2018 5:36 am

I am trying to dynamically create a TSeriesBandTool tool in C++Builder 10.1 using code such as ...

Code: Select all

TSeriesBandTool* ChartTool = new TSeriesBandTool(NULL);
TTeeCustomTool* customTool = Chart->Tools->Add(ChartTool);

TSeriesBandTool* Tool = dynamic_cast<TSeriesBandTool*>(customTool);
Tool->Series = MaxLine;
Tool->Series->Legend->Visible = false;
Tool->Series2 = MinLine;
Tool->Series2->Legend->Visible = false;
Tool->Brush->BackColor = TColor(16051931);
Tool->DrawBehindSeries = true;
Tool->Transparency = 50;
Tool->Active = true;
I am using TeeChart Pro v2017.21.170329 32 bit.

The code compiles and runs but the area between MinLine and MaxLine is not coloured.
Similar code works in another form where the TSeriesBandTool is statically created using the Chart Editor.

Can you help please.

Yeray
Site Admin
Site Admin
Posts: 9612
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: TSeriesBandTool with C++Builder 10.1

Post by Yeray » Wed Sep 12, 2018 10:10 am

Hello,

We've tested it here and this seems to work fine here:
seriesband.png
seriesband.png (27.43 KiB) Viewed 7640 times
Find below the code I've tested with TeeChart Pro VCL/FMX v2018.25 and RAD Studio 10.1 Berlin:

Code: Select all

    Chart1->View3D=False;
    Chart1->Legend->Hide();

    Chart1->AddSeries(new TLineSeries(NULL));
    Chart1->AddSeries(new TLineSeries(NULL));

    Chart1->Series[0]->FillSampleValues();
    Chart1->Series[1]->FillSampleValues();

    TSeriesBandTool* ChartTool = new TSeriesBandTool(NULL);
    TTeeCustomTool* customTool = Chart1->Tools->Add(ChartTool);
    TSeriesBandTool* Tool = dynamic_cast<TSeriesBandTool*>(customTool);
    Tool->Series = Chart1->Series[0];
    Tool->Series2 = Chart1->Series[1];
    Tool->Brush->BackColor = TColor(16051931);
    Tool->DrawBehindSeries = true;
    Tool->Transparency = 50;
    Tool->Active = true;
What TeeChart version are you using?
Could you please test the code above in a new simple test project?
If you still find problems with it, please arrange a simple example project we can run as-is to reproduce the problem here.

Thanks in advance.
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Post Reply