Is there a way of manually overriding the legend

Posted by: Yifan_Zhang on 13 April 2018, 5:14 pm EST

    • Post Options:
    • Link

    Posted 13 April 2018, 5:14 pm EST

    As for our need, we would like to have more flexibility over the legend to customize/override the default ones: so except for the current legend’s position and title, is it possible to be able to manipulate the legend item’s amount, legend item’s color and legend item’s label directly? It would be great if the legend class can be more exposed and isolated.

    Can this be a feature to be implemented in the near future? Thanks.

  • Posted 16 April 2018, 4:10 am EST

    Setting the series name changes the legend’s item label, similarly changing color of series also reflects the changes in legend.

    However, if you want legend’s item to have different color or style from series then series exposes legend via legendElement property. You can get an instance of legent as SVGGElement and style as per your preference.

    Refer to following example:- https://stackblitz.com/edit/angular-xj62i7?file=app%2Fapp.component.ts

Need extra support?

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

Learn More

Forum Channels