How to change the ZOrder of Marks?

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

How to change the ZOrder of Marks?

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
ZOrder.png (48.19 KiB) Viewed 9654 times

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

Re: How to change the ZOrder of Marks?

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:

Code: Select all

Chart1->SeriesUp(Series2);
SeriesUp and SeriesDown methods are calling ExchangeSeries internally. So another way to do the same in your case:

Code: Select all

Chart1->ExchangeSeries(0, 1);
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