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

Answered
1
0

Hi,

I have used WPF Chart Vertically Stacked YAxis example:
WPF Chart Vertically Stacked YAxis | Fast, Native, Charts for WPF (scichart.com)

and WPF Chart Multiple YAxis example:
WPF Chart Multiple YAxis | Fast, Native, Charts for WPF (scichart.com)

I have managed to achieve both individually but now essentially I would like to combine them.

I have been trying to alter the Right Axes Panel Template to allow this but it seems to only allow one or the other.

My main difference from the examples is that I have a collection of Yaxes of NumericAxisViewModel type in my viewmodel that is decided by the user at runtime before creating the chart and so is not defined in the xaml and bound with the YAxes property on the surface using AxesBinding.

I want to be able to vertically stack some of the Yaxes and have the rest stack horizontally side by side on the same axis alignment side, in my case the right side.

Is this something that is possible? If so how do I achieve this?

Let me know if you need any more info.

Cheers,
Grahame

Version
6.2.0.13254
  • You must to post comments
Best Answer
1
0

Hi Grahame,

To support a configurable axes panel layout, you can use a custom Grid control as the AxesPanelTemplate. This Grid control should override the OnVisualChildrenChanged method and place the axes using the SetRow/SetColumn methods.

The attached Grid.Row and Grid.Column properties can be used on the axis instance to configure the axis position.
In addition, you can define a custom attached property (e.g. IsStackedAxis) to differentiate stacked and regular axes.

If you are using MVVM API, all required properties (Row, Column, IsStackedAxis) should be defined in a custom axis view-model which inherits the appropriate SciChart view-model (e.g. NumericAxisViewModel). You can then use the ViewModel.StyleKey property to set an axis style which binds view-model properties to attached properties on the axis.

I have attached a small example which shows all the implementation details.

Best regards,
Demien

  • You must to post comments
1
0

Hi Grahame

This is a difficult requirement and not something that can easily be done but I’d like to try!

Could you:

  • Share with me so far the code you’ve got to lay out the chart
  • Share with me an image or screenshot of desired layout of axis

Also telling us why you need this (what is the use case) will help

Best regards
Andrew

  • You must to post comments
1
0

Hi Andrew,

I have attached a small example application of my code.

Also attached is an image I cobbled together from some screenshots of what I can achieve to produce the desired result.

The use case for this is to be able to have axis based on enumerations stacked vertically as they only have a few values. Then to have the rest of axis with numeric data to be stacked horizontally as before.

In my example the red and blue graph plots are the enumerated axes.

Cheers,
Grahame

Attachments
Images
  • You must to post comments
1
0

Brilliant, works like a charm! Thanks Demien.

Grahame

  • You must to post comments
Showing 4 results
Your Answer

Please first to submit.