SciChart WPF 2D Charts > Axis APIs > Axis Alignment - Setting Axis Alignment
Axis Alignment - Setting Axis Alignment

Multi-Axis Charts

In SciChart, it is required that each Axis in a corresponding Axis Collection has a unique identifier. This is a string that can be provided via the Axis.Id property. By default, all axes have a default Axis ID.

For single-axis charts there is no need to set Axis Id. As soon as there is a secondary Axis, you need to start assigning IDs to all Axes in the corresponding Axis Collection.

In such multiple-axis scenarios, some SciChart types such as Renderable Series, Annotations, Chart Modifiers can be associated with a certain Axis. Their API usually exposes XAxisId and YAxisId properties that can be used to associate this type with a specific X or Y Axis.

NOTE: By default, these SciChart types are associated with X and Y Axes that have the default axis ID. As soon as you set Axis.Id on an Axis explicitly you must consider whether you need to update your Renderable Series, Annotations or Chart Modifiers by setting the XAxisId or YAxisId properties.

XAxis on the Top/Bottom

SciChart supports unlimited XAxis on the top or bottom of the chart. To set the alignment of an axis, simply set the AxisBase.AxisAlignment property.

XAxis on the Top/Bottom
Copy Code
<s:SciChartSurface>
   <s:SciChartSurface.YAxis>
      <s:NumericAxis AxisAlignment="Right" AxisTitle="YAxis"/>
   </s:SciChartSurface.YAxis>

   <s:SciChartSurface.XAxes>
      <s:NumericAxis AxisAlignment="Top" AxisTitle="XAxis 0"/>
      <s:NumericAxis Id="SecondaryXAxis" AxisAlignment="Bottom" AxisTitle="XAxis 1"/>
      <s:NumericAxis Id="TeriaryXAxis" AxisAlignment="Bottom" AxisTitle="XAxis 2"/>
   </s:SciChartSurface.XAxes>
</s:SciChartSurface>

Results in

YAxis on the Left/Right

SciChart supports unlimited YAxis on the left or right of the chart. To set the alignment of an axis, simply set the AxisBase.AxisAlignment property.

YAxis on the Left/Right
Copy Code
<s:SciChartSurface>
   <s:SciChartSurface.XAxis>
      <s:NumericAxis AxisAlignment="Bottom" AxisTitle="XAxis"/>
   </s:SciChartSurface.XAxis>

   <s:SciChartSurface.YAxes>
      <s:NumericAxis AxisAlignment="Left" AxisTitle="YAxis 0"/>
      <s:NumericAxis Id="SecondaryYAxis" AxisAlignment="Right" AxisTitle="YAxis 1"/>
      <s:NumericAxis Id="TeriaryYAxis" AxisAlignment="Right" AxisTitle="YAxis 2"/>
   </s:SciChartSurface.YAxes>
</s:SciChartSurface>

Results in

See Also