ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Supress axis 2 legend
Posted by KeithB on Jul-10-2024 00:40
I am creating a two Y-Axis graph with a legend. By default it shows the legends for both axes. I would like to suppress the Y2 legend and only show the one.

  Re: Supress axis 2 legend
Posted by Peter Kwan on Jul-10-2024 11:23
Hi KeithB,

When you add a data series to the chart (eg. using addLineLayer, addBarLayer, ...), and your data series has a name, and your chart has a legend box, then by default ChartDirector will add your data series to the legend box.

If you do not want the automatic legend entry, you can using Layer.setLegendOrder. For example:

myLayer.setLegendOrder(Chart.NoLegend);


See:

https://www.advsofteng.com/doc/cdnet.htm#Layer.setLegendOrder.htm

Best Regards
Peter Kwan

  Re: Supress axis 2 legend
Posted by KeithB on Jul-10-2024 22:29
Perfect, Thanks!