SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components
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.
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!
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.
<!-- 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!
Please login first to submit.