Pre loader

Multiple chart Y axis label alignment

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

1
0

For the image in attachement, the user choses which charts he wants to see. How do we align the y-axis labels to the right against the axis?

Version
4.2
Images
  • You must to post comments
1
0

Thank you for the answer Yuriy but we’ve already tried that:

In my style ressource class:

<!-- Y Axis styling -->
<Style x:Key="LeftAxisStyle" TargetType="s:NumericAxis">
    <Setter Property="AxisAlignment" Value="Left"/>
    <Setter Property="AutoTicks" Value="True"/>
    <Setter Property="MinorsPerMajor" Value="5"/>
    <Setter Property="DrawMajorTicks" Value="True"/>
    <Setter Property="DrawMajorGridLines" Value="False"/>
    <Setter Property="DrawMinorTicks" Value="True"/>
    <Setter Property="DrawMinorGridLines" Value="False"/>
    <Setter Property="GrowBy" Value="0.05, 0.05"/>
    <Setter Property="Width" Value="65"/>
    <Setter Property="MajorGridLineStyle" Value="{DynamicResource MajorGridLineStyle}"/>
    <Setter Property="MinorGridLineStyle" Value="{DynamicResource MinorGridLineStyle}"/>
    <Setter Property="TickTextBrush" Value="{DynamicResource MainForegroundColor}"/>
    <Setter Property="TickLabelStyle" Value="{DynamicResource LeftAxisLabelStyle}"/>
</Style>

<Style x:Key="LeftAxisLabelStyle" TargetType="s:DefaultTickLabel">
    <Setter Property="HorizontalAnchorPoint" Value="Right"/>
    <Setter Property="HorizontalAlignment" Value="Right"/>
    <Setter Property="HorizontalContentAlignment" Value="Right"/>
</Style>

In my view:

[...]
        <s:SciChartSurface.YAxis>
            <s:NumericAxis
                x:Name="YAxis" 
                AxisTitle="{Binding Title}" 
                TitleStyle="{StaticResource LeftAxisTitleStyle}" 
                Style="{DynamicResource LeftAxisStyle}"
                FlipCoordinates="{Binding InverseYAxis}"
                s:CursorModifier.AxisLabelContainerStyle="{DynamicResource VisibleAxisLabelStyle}"/>
        </s:SciChartSurface.YAxis>
[...]
  • Yuriy Zadereckiy
    Hi Mathias, thanks for your reply. Taking closer look at the screenshot, I’ve noticed that the charts are aligned horizontally. Do you synchronize axis sizes using VerticalChartGroup?
  • Mathias Vanden Auweele
    Aaah that’s something new. We weren’t aware of the verticalchartgroup property and were setting a fixed axis width (I copied the wrong style in my previous post before, I edited it to the right one). That solved the problem, thanks!
  • You must to post comments
1
0

Hi Mathias,

Thanks for your question. There is the TickLabelStyle property in AxisBase that allows to provide a style for axis labels. You need to provide a style and set there HorizontalAlignment to “Right”. Then set it on an axis which labels have to be aligned.

Here is the documentation article for reference:
https://www.scichart.com/documentation/v4.x/webframe.html#Axis%20Styling%20-%20Templating%20Axis%20Labels.html

Hope this helps!

Best regards,
Yuriy

  • You must to post comments
Showing 2 results
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