TeeChart FireMonkey (Windows,OSX,iOS & Android) for Embarcadero RAD Studio, Delphi and C++ Builder (XE5+)
-
elmec
- Advanced
- Posts: 129
- Joined: Mon Aug 26, 2013 12:00 am
Post
by elmec » Thu Jul 03, 2014 7:41 am
I tried to switch Marks zorder by changing the property of ZOrder of series,
but nothing happened.
Do you have any advice?
Code: Select all
__fastcall TForm12::TForm12(TComponent* Owner)
: TForm(Owner)
{
// Add two Point series
Series1 = new TPointSeries(NULL);
Series1->ParentChart = Chart1;
Series1->Marks->Visible = true;
Series2 = new TPointSeries(NULL);
Series2->ParentChart = Chart1;
Series2->Marks->Visible = true;
for (int n = 0; n < 5; n++)
{
Series1->Add(n + 1, "Marks1");
Series2->Add(n + 1, "Marks2");
}
}
void __fastcall TForm12::btnChangeZOrderClick(TObject *Sender)
{
// I tried to bring Series1 to front by changing it's ZOrder,
// but the marks of Series1 is still behind Series2
Series1->ZOrder = 100;
}
-
Attachments
-
- ZOrder.png (48.19 KiB) Viewed 9803 times
-
Yeray
- Site Admin
- Posts: 9622
- Joined: Tue Dec 05, 2006 12:00 am
- Location: Girona, Catalonia
-
Contact:
Post
by Yeray » Thu Jul 03, 2014 11:42 am
Hello,
The drawing order is determined by the index of the series in the Chart SeriesList.
As you create the series, Series1 has the index 0 and Series2 has the index 1. So Series2 is drawn after Series1.
You can change this with:
SeriesUp and SeriesDown methods are calling ExchangeSeries internally. So another way to do the same in your case: