I am building an application that plots over 600 series, I want to have a method of filtering the series in the legend, is this possible with SciChart Legend API?
Also, how can I set the checkbox’s of all the series to unchecked as defualt when data is imported? At the moment, when the data is pulled into the application the legend populates the series and the checkboxes are checked as default.
If I can supply any further information, please let me know.
Thanks
- Jordan Ballantyne asked 6 years ago
- You must login to post comments
Hi Jordan
In SciChart WPF v4
The SciChart LegendModifier has the property GetLegendDataFor. This allows you to choose series which are displayed in the legend from an enumerated list { AllSeries, AllVisibleSeries, SelectedSeries, UnselectedSeries }.
Potentially you could use a combination of RenderableSeries.IsSelected and LegendModifier.GetLegendDataFor = SelectedSeries to control which series are in the legend.
In SciChart WPF v5
The SciChart LegendModifier has the attached property IncludeSeries, which can be placed right on the series itself to control showing or not.
Usage:
<s:SciChartSurface.RenderableSeries>
<s:FastLineRenderableSeries s:LegendModifier.IncludeSeries="False"/>
<s:FastLineRenderableSeries s:LegendModifier.IncludeSeries="True"/>
</s:SciChartSurface.RenderableSeries>
regarding the checkbox
In both versions of scichart, the Checkbox is bound to RenderableSeries.IsSelected. If you set IsSelected = false on the series, the checkbox will be unchecked.
Best regards,
Andrew
- Andrew Burnett-Thompson answered 6 years ago
-
Thank you Andrew, I was hoping to implement something along the lines of a textbox that the user could type into to filter the legend, would this be possible?
-
It would be – but you’d have to implement the textbox yourself. Subscribe to TextChanged, and search SciChartSurface.RenderableSeries.Where(x => MatchesSomeTextsearch(x.DataSeries.SeriesName)); Next, set the attached property LegendModifier.IncludeSeries to true or false on the series itself. This will filter the legend dynamically as a user types.
- You must login to post comments
Please login first to submit.