Recent

Author Topic: legend order  (Read 2633 times)

mtanner

  • Sr. Member
  • ****
  • Posts: 287
legend order
« on: January 26, 2017, 02:21:47 pm »
Is there an option to reverse the default order in which legend itens appear? I cannot find one. I have stacked bar chart. The legend items appear in the reverse order to the order in which the stacking is done, which looks a bit odd. There is an Inverted option in TeeChart, is there a corresponding option in TChart?

wp

  • Hero Member
  • *****
  • Posts: 11854
Re: legend order
« Reply #1 on: January 26, 2017, 04:14:13 pm »
Normally you would set the Order parameter of the series' Legend property if you want a custom legend order. But this is not possible in case of multiple y values. Instead of twiggling an Order parameter into TChartStyle I decided to go conformal with Delphi and introduced an Inverted property to TChartLegend in r54009. Note that if legend items are grouped then Inverted operates only on the legend items belonging to the same group.

Please see the attached demo - requires Lazarus trunk >= r54009.

 

TinyPortal © 2005-2018