How to get currently visible series/models in Syncfusion Blazor Chart at any given time?
Hi,
I need to determine which series/models are currently visible in a Syncfusion Blazor Chart, especially after the user toggles series visibility via the legend. My requirement is to get the actual visible series at any time (e.g., for saving user selections). However, I can’t find a way to do this—SeriesList only reflects the initial state, not legend toggles. The legend click event handler also breaks default toggling behavior.
What I’ve tried:
- Using the `Visible` property on my model (`SeriesInfo.IsVisible`)—this only reflects the initial state, not legend toggles.
- Handling `OnLegendClick` to try to track visibility, but this breaks the default legend toggling (series can’t be toggled off again).
- Searching the chart API for a way to get the actual visible series/models after legend interaction, but found nothing.
What I need:
A reliable way to get the list of currently visible series/models at any time, reflecting the user’s legend toggles. This is needed for saving user selections and for other business logic.
Minimal Repro (runnable):
Check out the code to see what I've tried so far and failed.
https://blazorplayground.syncfusion.com/rDBIiBiRmNVlhffR
Questions:
- Is there a built-in way to get the current visible series/models from the chart component?
- If not, what’s the recommended approach to track this in a Blazor/Syncfusion Chart?
This seems like a trivial feature, but I haven’t found a solution even after handful of attempts.
Help would be greatly appreciated!
Repro code (for future reference):
Run the code to see the issue. I can't make the toggle work correctly and can't get the selected models at any given time.
Also check out the screen recording
Attachment: visibleseriesbug_c1292f4e.gif
Ok I figured out the solution.
Here's the full code with the fix:
Hi Ashish,
Thank you for the update and for sharing the complete solution. We appreciate you taking the time to investigate and resolve the issue. Your approach will be helpful for others facing a similar scenario.
Please let us know if you need any further assistance or have other questions. We’re always here to help.
Regards,
Durga Gopalakrishnan.
- 4 Replies
- 2 Participants
- Marked answer
-
AK Ashish Khanal
- Dec 16, 2025 07:41 PM UTC
- Dec 17, 2025 01:05 PM UTC