![]() | Steema Issues DatabaseNote: This database is for bugs and wishes only. For technical support help, if you are a customer please visit our online forums;otherwise you can use StackOverflow. Before using this bug-tracker we recommend a look at this document, Steema Bug Fixing Policy. |
| Summary: | TChartSeries.BringToFront() function | ||
|---|---|---|---|
| Product: | VCL TeeChart | Reporter: | narcís calvet <narcis> |
| Component: | Series | Assignee: | Steema Issue Manager <issuemanager> |
| Status: | CONFIRMED --- | ||
| Severity: | enhancement | CC: | henk |
| Priority: | --- | ||
| Version: | 140512 | ||
| Target Milestone: | --- | ||
| Hardware: | PC | ||
| OS: | Windows | ||
| URL: | http://stackoverflow.com/questions/24822830/teechart-how-to-bring-a-series-to-the-front | ||
| Chart Series: | --- | Delphi / C++ Builder RAD IDE Version: | |
I am trying to bring certain series on a TChart component to the front(as you would typically do with a BringToFront() function). I've done some reading and found the following options/suggestions: A. Change the ZOrder property of the series. B. Use TChart.ExchangeSeries() Using TChart.ExchangeSeries() is not a proper way of changing the z-order of a series. Its primary function is to swap around two series in a TChart component's SeriesList(which then inherently changes the z-order of those series). If you require your series-ordering to be fixed(fixed ordering in SeriesList), then this will not work. Changing the ZOrder properties of the series delivered better results. However, changing the ZOrder of the first series(Series[0]) apparently does nothing. Series[0] seem to like sitting at the back of the class. The above might be the result of my implementation. In which case, come more details: On my TChart component I have multiple series. The series-types can be changed dynamically. The types to which the series can be changed are limited to TLineSeries and TBarSeries. I always want the TLineSeries at the front. Any advice on how this can be done? (Will we ever see that elusive TChartSeries.BringToFront() function?) Even changing ZOrder or assigning StackGroups to the Bar series, the later are always plotted in the front overlapping with line series, for example: uses Series; procedure TForm1.FormCreate(Sender: TObject); begin Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues(10); Chart1.AddSeries(TLineSeries.Create(Self)).FillSampleValues(10); Chart1.AddSeries(TBarSeries.Create(Self)).FillSampleValues(10); Chart1.AddSeries(TBarSeries.Create(Self)).FillSampleValues(10); Chart1.AddSeries(TBarSeries.Create(Self)).FillSampleValues(10); end; procedure TForm1.Button1Click(Sender: TObject); var i: Integer; begin for i:=0 to Chart1.SeriesCount-1 do begin Chart1[i].Marks.Visible:=False; if Chart1[i] is TLineSeries then Chart1[i].ZOrder:=Chart1.SeriesCount - 1 - i else Chart1[i].ZOrder:=i; end; end;