Pre loader

Treat a LineSeries and a ErrorBarSeries as one - turn on/off at the same time?

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

Hi!

I would like to plot a series as a solid line AND include error bars. The way I do this now is to define a single series:

var fSeries    = new HlcDataSeries<double, double>();
fSeries.SeriesName = $"My Series!";

And then two different ViewModels:

var fLineVm = new LineRenderableSeriesViewModel();
var fErrorVm = new ErrorBarsRenderableSeriesViewModel();

And set the data series to belong to both:

fLineVm.DataSeries = fSeries;
fErrorVm.DataSeries = fSeries;

This looks ok. But when I show the legend, I see “My Series” in the legend twice, and I can control the error bars separately from the line series.

What I want to happen is that I see the series a single time in the legend and if I turn it off (uncheck it) everything disappears.

Right now, i’m adding those two ViewModels to an ObservableCollection of IRenderableSeriesViewModels and then SeriesBinding to display them.

Version
5.4.0.12119
Attachments
Images
  • You must to post comments
0
0

Hi David,

Thanks for your inquiry.

I’ll copy the answer from the support ticket here:

You will have to deal with two RenderableSeries anyway. However, you can achieve the desired behaviour of the LegendModifier. You can set the attached property LegendModifier.IncludeSeries to False for the ErrorBarsRenderableSeriesViewModel to exclude it from the LegendModifier. Please take a look at the following documentation for more info:
https://www.scichart.com/documentation/v5.x/webframe.html#LegendModifier.html

There is also IsVisible property for both RenderableSeries. If you bind these properties both RenderableSeries will hide if you uncheck one of them in the LegendModifier.

Hope this helps.

  • 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