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.
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!
Please login first to submit.