Pre loader

Legend Filter

Welcome to the SciChart Forums!

  • Please read our Question Asking Guidelines for how to format a good question
  • Some reputation is required to post answers. Get up-voted to avoid the spam filter!
  • We welcome community answers and upvotes. Every Q&A improves SciChart for everyone

WPF Forums | JavaScript Forums | Android Forums | iOS Forums

0
0

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

Version
v4.2.4
  • You must to post comments
0
0

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

  • Jordan Ballantyne
    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?
  • Andrew Burnett-Thompson
    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 to post comments
Showing 1 result
Your Answer

Please first to submit.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies