Pre loader

Custom LegendModifier data bind from an MVVM enviroment

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



I recently made the switch from using RenderableSeries directly to using the RenderableSeriesViewModel. We used to add LegendData manually when we added a series to the graph (as we don’t want all the series to show up on the legend).

But looking at how legends are displayed, it requires the RenderableSeries object itself, which of course I no longer have access to.

How can I go about adding custom SeriesInfo without any RenderableSeries.

  • You must to post comments
Good Answer

Hi Kewur,

Thank you for pointing this out to us. You are right, current MVVM API doesn’t allow selecting specific series for a legend. There is a couple of workarounds I would suggest trying.

You could override the IsSeriesValid method of LegendModifier. In method override just return “False” for those series you don’t want to appear in a legend. You can distinguish them using the Tag property of RenderableSeries or DataSeries, or DataSeries.SeriesName.

Another possible solution can be creating a custom RenderableSeries based on any existing type and overriding GetSeriesInfo() there. Then you can create a ViewModel for it and use with MVVM API.

Hope this helps!

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.