About the behavior of TScrollPager

TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
Post Reply
elmec
Advanced
Posts: 129
Joined: Mon Aug 26, 2013 12:00 am

About the behavior of TScrollPager

Post by elmec » Mon Jun 30, 2014 9:41 am

Question1:
When I assign a Series to TScrollPager like the following code,
it just set the pointor of ScrollPager->Series to seriesTest,
or copy seriesTest to ScrollPager->Series?

Code: Select all

TFastLineSeries* seriesTest = new TFastLineSeries(this);
ScrollPager->Series = seriesTest;
Question2:
How does ScrollPager->SetUpScrollPager() function behave?
When resizing TChart, it should be called?
Even I have called it when TChart resized,
the color of ScrollPager->ColorBandTool seems not being remembered.

Question3:
ScrollPager->SubChartTChart->RemoveAllSeries() works same with Chart->RemoveAllSeries()?
it just disconnect all the series with ScrollPager->SubChartTChart?
FreeAllSeries() function should be called if want all the series to be deleted?

BTW, I am using the newest version (2014) for Firmonkey XE4 .

elmec
Advanced
Posts: 129
Joined: Mon Aug 26, 2013 12:00 am

Re: About the behavior of TScrollPager

Post by elmec » Mon Jun 30, 2014 9:47 am

Question4:
We know that there are two series when I assign a Series (seriesTest) to TScrollPager,
one is in the TChart, and another is in the ScrollPager->SubChartTChart.
The two series just have a pointer to seriesTest?
Or the one in the TChart also has a copy of seriesTest?

elmec
Advanced
Posts: 129
Joined: Mon Aug 26, 2013 12:00 am

Re: About the behavior of TScrollPager

Post by elmec » Mon Jun 30, 2014 10:18 am

I am sorry , pls ignore Question4..
And for Question 1, before assigning series to TScrollPager,
the series should have a parentchart..so the code should be as following.

Code: Select all

TFastLineSeries* seriesTest = new TFastLineSeries(this);
seriesTest->ParentChart = Chart1;
ScrollPager->Series = seriesTest;

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

Re: About the behavior of TScrollPager

Post by Yeray » Tue Jul 01, 2014 9:40 am

Hello,

If I understand it correctly, there are only Q2 and Q3 pending.
elmec wrote:Question2:
How does ScrollPager->SetUpScrollPager() function behave?
When resizing TChart, it should be called?
Even I have called it when TChart resized,
the color of ScrollPager->ColorBandTool seems not being remembered.
SetUpScrollPager is called when the Series is assigned to it. This is public just for special cases but in general you don't need to call it. It initializes the two Charts and the ColorBand.
One of the things it does is setting the ColorBand color to match the Series color. That's why calling this resets the color of the ColorBand if you manually changed it.
elmec wrote:Question3:
ScrollPager->SubChartTChart->RemoveAllSeries() works same with Chart->RemoveAllSeries()?
it just disconnect all the series with ScrollPager->SubChartTChart?
FreeAllSeries() function should be called if want all the series to be deleted?
Note the ScrollPager creates a SubChart with a TChart in it. And SubChartTChart returns this Chart in the SubChart.
Also note assigning a Series to the ScrollPager clones the given series and adds this clone to the Chart in the SubChart.
Then, SubChartTChart->RemoveAllSeries is removing all the series in the SubChart, but does nothing to the Series in the main Chart. And Chart->RemoveAllSeries removes all the series in the main Chart, but does nothing with the Series in the SubChart.
If you want to clear both charts, you have to call both functions.
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