Pre loader

Features missing in IAxisViewModel (compared to IAxis)

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



Our view models currently hold AxisCollection and work with IAxis. We’re hoping to switch to working with IAxisViewModel at this level.
But some feature differences will make this harder:

  • IAxis.TickLabelStyle – view model only supports TickTextBrush, not the other font related properties we customise in this style.
  • SImilarly MajorGridLineStyle and MinorGridLineStyle
  • Is IAxisViewModel.StyleKey the equivalent of IAxis.TitleStyle? (we just need to move our style definitions to XAML instead of creating Style objects in code)
  • Is IAxisViewModel.VisibleRange equivalent to IAxis.DataRange?

Can there be equivalent IAxisViewModel.TickLabelStyleKey, similarly Minor/Major grid line StyleKey?

Our view models hang around to hold logical state of charts. But they also hold some AxisCollection, bound to from SciChartSurface.

We get exceptions like: InvalidOperationException Element already has a logical parent, under SciChart methods in the call stack.
E.g. when reconnecting to a PC over remote desktop, where a chart was already loaded.

This change was also suggested as a solution to our other recent issue, here:

The “Element already has a logical parent” exception doesn’t happen when clicking between multiple charts like that latter issue. I’ve prototyped a changeover (commenting out all the bits not directly equivalent) and it seems to resolve this exception.

SciChart v5.5
  • You must to post comments

Hi Michael

Any property can be set on the Axis / Series / Annotation with our MVVM API using styles. The process to do this is as follows.

Worked Example – Style a Series in MVVM

Above: The example for a series can be adapted to an axis as follows

  <Style TargetType="s:NumericAxis" x:Key="AxisStyle">
     <!-- Put setters for axis here -->

  <s:SciChartSurface YAxes="{s:AxisBinding YAxes}">

In your viewmodel, you tell the axis to use style key ‘AxisStyle’ as follows.

   public ObservableCollection<IAxisViewModel> YAxes
         get { return _yAxes; }

   YAxes.Add(new NumericAxisViewModel() { StyleKey = "AxisStyle" });

Best regards,

  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.