Search code examples
anychart

Anychart - Deselected legend item color


How can I change the color of items in the legend when they are turned off? Right now I know how to do is change the color of a series, which then changes the color of the items on the legend (but only while they are not switched off). I also know how to permanently change the color of legend items, but I don't know how to choose the color that they change to when turned off.


Solution

  • Currently, this setting is not available via API directly, but you can use this workaround:

    1. clone the rep: https://github.com/AnyChart/AnyChart/
    2. change the settings here: https://github.com/AnyChart/AnyChart/blob/master/src/core/ui/LegendItem.js#L66-L73
    3. build the js: https://github.com/AnyChart/AnyChart/#build-and-debug