SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

Answered
2
0

Hi guys,

I’m tackling a difficult problem in my solution here. Our chart will allow users to add as many as 50 different series at any one time.

As well as this – the user will be able to specify the RenderableSeries (Chart Type) of each of these between; column, line and mountain.

One solution is to replicate the method found in your own SciChart SciTrader demonstration (in which each type of RenderableSeries is added to the xaml once for each data series, they share a DataSeries and then the Visibility property within the style is managed to only show the one the user requests), but this would require 150 (50 placeholders for 50 possible series * 3 definitions per series) definitions of different RenderableSeries, each with their own Style defined.

Is there any way to create a custom RenderableSeries that extends BaseRenderableSeries and add a DependencyProperty that allows a binding from the xaml to modify the type of RenderableSeries that is displayed?

Even better – is there a way to add RenderableSeries using MVVM (I noticed the add/remove dynamic series tutorial has a note to standby for such a tutorial). I will attempt to find a solution by going down this path as it sounds much less verbose.

Thanks in advance for all your help!
Miles

  • You must to post comments
Best Answer
4
0
Images
  • Simkins Ben
    Note for latecomers like me: the LineSerieSource class needs to inherit from DependencyObject
  • Andrew
    Hello! If the property is RegisterAttached then you should be able to declare it in a plain CLR type (no need for DependencyObject).
  • You must to post comments
0
0

Whilst this approach is working fine for FastColumnRenderableSeries, I experience a strange behaviour using the new StackColumnRendererableSeries from v3.2. In fact, when switching the DataSeries to a different ViewModel, the chart columns are misplaced and start to blink very second (turned on and off by itself) without any exception being thrown.

Did I run into a bug here?

    • Guest
    • 4 years ago
    • 1
    Ah yes you did. Just comment out the line sciChartSurface.RenderableSeries.Clear(). Does it help? There is a known issue in v3.2 when you clear the RenderableSeries it causes internal state to get lost. As a workaround you can set sciChartSurface.RenderableSeries = new ObservableCollection()
  • swiedric
    Hi Andrew, yes, commenting out the Clear() function helped to get the Chart stable. Thanks, Silvio
  • Andrew
    No probs :) We're going to fix it as a bug and push to v3.2.1 soon
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.