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!
- Straliciuc asked 12 years ago
- You must login to post comments
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!
- Andrew Burnett-Thompson answered 12 years ago
- You must login to post comments
Please login first to submit.