Pre loader

How to align axes vertically?

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

Answered
1
0

Hello guys, what would be the best option for aligning the axes vertically in the case when there are at least two y axes?

What I mean by vertical alignment:
The value 0 should be on the same grid line for both axes
The major ticks for both axes should snap to the grid lines

Btw, SciChart is awesome!

  • You must to post comments
Best Answer
1
0

Hi Straliciuc, thanks for the positive feedback!

Are you able to share a screenshot of what you have now, and what you are trying to achieve? I don’t quite understand what you need.

There are a few things that help with alignment of YAxes – if you have multiple charts (vertical) and want YAxis widths to be the same width, there is an attached property to synchronize the widths of the axes:

<!-- Using VerticalChartGroup, chart0 and chart1 -->
<!-- YAxis widths will be synchronized -->
<s:SciChartSurface x:Name="chart0" 
       s:SciChartGroup.VerticalChartGroup="chartGroup">
    <s:SciChartSurface.YAxis>
        <s:NumericAxis/>
    </s:SciChartSurface.YAxis>
</s:SciChartSurface>

<s:SciChartSurface x:Name="chart1" 
       s:SciChartGroup.VerticalChartGroup="chartGroup">
    <s:SciChartSurface.YAxis>
        <s:NumericAxis/>
    </s:SciChartSurface.YAxis>
</s:SciChartSurface>

If however you have a chart with two YAxes and want the zero lines to be the same, here you would have to set the VisibleRange manually.

Another trick which we use with mutliple YAxis charts is to disable the GridLines of secondary Y-Axis.

e.g.

<!-- When you have two or more Y-Axes -->
<!-- hide the grid lines of subsequent axes -->
<s:SciChartSurface x:Name="chart0" 
       s:SciChartGroup.VerticalChartGroup="chartGroup">
    <s:SciChartSurface.YAxes>
        <s:NumericAxis />
        <s:NumericAxis Id="SecondaryAxis" 
                       DrawMajorGridLines="False" 
                       DrawMinorGridLines="False"/>
    </s:SciChartSurface.YAxes>
</s:SciChartSurface>

Please let me know if this is helpful. If not – any information you can give us to help solve the problem would be appreciated!

  • 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