Recent

Author Topic: legend to front  (Read 424 times)

mtanner

  • Sr. Member
  • ****
  • Posts: 279
legend to front
« on: December 15, 2020, 10:39:47 pm »
Is there a way with TAChart to force the legend to be at the fromt, on top of all series, grids etc?

wp

  • Hero Member
  • *****
  • Posts: 8399
Re: legend to front
« Reply #1 on: December 15, 2020, 10:52:51 pm »
You mean inside the axis rectangle? Set Chart.Legend.UsePanel to false to move the legend from outside ("panel") into the axis area. Use Chart.Legend.Alignment to put the legend at another place, and .MarginX and .MarginY to move it further away from or closer to the border.
Mainly Lazarus trunk / fpc 3.2.0 / all 32-bit on Win-10, but many more...

mtanner

  • Sr. Member
  • ****
  • Posts: 279
Re: legend to front
« Reply #2 on: December 16, 2020, 10:06:11 am »
Thanks for the hint. Actually my problem was a bug. My chart is a stacked area chart with the data areas occupying almost all of the plot area. The legend was not visible, and I though it was being hidden by the data. But my program provides a user switch to hide/disply the legend, and the wrong switch was being used because of an ambuguity in using nested "With MYCLASSA do begin With MYCLASSB do begin". So I shall avoid such nested with's.

 

TinyPortal © 2005-2018