Filtering Legend Area

Posted by: svaz on 8 September 2017, 2:02 pm EST

  • Posted 8 September 2017, 2:02 pm EST


    In Excel charts and most charting components it is possible to filter the items that appear in the legend area. This is very useful in financial applications where comparison of assets against peer groups of assets are very common. For example if two assets are compared against a peer group of 50 assets, in the legend area you want to show the two assets and a single item to represent the peer group and filter the other 49 assets from legend area. I hope you could also make this functionality available in your charting component.


    Many Thanks


  • Replied 8 September 2017, 2:02 pm EST


    In Excel, you can use mouse to select an entry in legend and then press <Delete> key to remove the entry from the legend.

    In Spread's chart, you can achieve a similar affect using the LegendAreaId property in the Series class.  Spread's chart supports multiple legend areas.  Both the LegendArea and the Series classes have a LegendAreaId property.  A given legend area only displays series with a matching LegendAreaId.  If you set a series's LegendAreaId to a value that does not match any legend area's LegendAreaId then the series will not be displayed on any legend area.  For example, if you have a single legend area with LegendAreaId = 0 (which is the default) then you could remove a series from the legend area using the following code...

        series.LegendAreaId = 999;

Need extra support?

Upgrade your support plan and get personal unlimited phone support with our customer engagement team

Learn More

Forum Channels