Page 1 of 1

About the behavior of TScrollPager

Posted: Mon Jun 30, 2014 9:41 am
by 16566869
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 .

Re: About the behavior of TScrollPager

Posted: Mon Jun 30, 2014 9:47 am
by 16566869
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?

Re: About the behavior of TScrollPager

Posted: Mon Jun 30, 2014 10:18 am
by 16566869
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;

Re: About the behavior of TScrollPager

Posted: Tue Jul 01, 2014 9:40 am
by yeray
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.