BoldDeskWe are launching BoldDesk on Product Hunt soon. Learn more & follow us.
Hi,
Here's the idea, click a legend to turn the referenced chart off ( by changing the isVisible property), click again to turn it on.
I tried it in onLegendTapped and it works.
Though, when a chart is turned off, I hope it's legend change to a customizable color like grey instead of white, and still show it's title, is that possible?
Hi Zhu,
We are validating your query and trying to create a feasible workaround for your requirement, and we need time on this we will update the status in one business day on 27 January 2023. We appreciate your patience until then.
Regards,
Yuvaraj.
Hi, Yuvaraj,
Great, that sounds good.
Regards,
Zhu
Hi Zhu,
Thanks for your patience.
Your requirement can be achieved with the help of the legendItemBuilder property in the legend, which is used to render a custom widget instead of an actual legend. Here we have rendered a custom shape widget with a series color and changed the color of the widget based on the series visibility. We have shared the sample below for your requirement, you can modify the sample as per your requirement.
Screenshot:
Regards,
Yuvaraj.
Hi, Yuvaraj,
There's an issue that in legendItemBuilder, the legend text color would change when seriesVisibility is turned off, that works well when background color is white, but not in other colors.
Is there an internal logic doing that? what to do to control the color all by myself?
Best Regards,
Zhu
Hi Zhu,
We are checking your query and trying to create a feasible workaround for your requirement, and we need time on this we will update the status in one business day on 3 February 2023. We appreciate your patience until then.
Regards,
Yuvaraj.
Hi Zhu,
We have created a sample with the help of the legendItemBuilder property and wrapped the custom legend with GestureDetector and handled the legend icon color and series visibility change in its onTap callback. We have shared the sample below for your reference, you can modify it as per your requirements.
Screenshot: