SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and iOS Chart & Android Chart Components

Welcome to the SciChart Community Forums!

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.

0
0

Hi,
I’m wondering, if there any chance to hide or change the font size of XAxis label numbers.
Thanks

  • You must to post comments
0
0

Hello,

Yes, there is – you can set XAxis.DrawLabels=false to hide the X-labels. Also all elements are stylable via XAML, we have a Silverlight demonstration app that shows you how to do this.

An example of a XAML style is here:

 <!-- Define styles for the X and Y Axes -->
        <Style x:Key="AxisStyle" TargetType="sciChart:AxisBase">
            <Setter Property="FontSize" Value="12"/>
            <Setter Property="FontWeight" Value="Normal"/>
            <Setter Property="TitleFontSize" Value="12"/>
            <Setter Property="TitleFontWeight" Value="Bold"/>
            <Setter Property="TickTextBrush" Value="Crimson"/>
            <Setter Property="MajorTickLineStyle">
                <Setter.Value>
                    <Style TargetType="Line">
                        <Setter Property="Stroke" Value="GreenYellow"/>
                        <Setter Property="StrokeThickness" Value="2"/>
                        <Setter Property="X2" Value="8"/>
                        <Setter Property="Y2" Value="8"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="MinorTickLineStyle">
                <Setter.Value>
                    <Style TargetType="Line">
                        <Setter Property="Stroke" Value="Violet"/>
                        <Setter Property="StrokeThickness" Value="1"/>
                        <Setter Property="X2" Value="4"/>
                        <Setter Property="Y2" Value="4"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="MajorGridLineStyle">
                <Setter.Value>
                    <Style TargetType="Line">
                        <Setter Property="Stroke" Value="GreenYellow"/>
                        <Setter Property="StrokeThickness" Value="2"/>
                    </Style>
                </Setter.Value>
            </Setter>
            <Setter Property="MinorGridLineStyle">
                <Setter.Value>
                    <Style TargetType="Line">
                        <Setter Property="Stroke" Value="Violet"/>
                        <Setter Property="StrokeThickness" Value="1"/>
                    </Style>
                </Setter.Value>
            </Setter>
        </Style>

Best regards,
Andrew

  • Amir
    Thanks Andrew It works.
  • rcannon
    In SciChart's newest version, is there a way to programmatically hide the x axis labels on a datetime axis?
  • Andrew
    Hi there, yes there is, from the post above:
    you can set XAxis.DrawLabels=false to hide the X-labels
  • rcannon
    I ask because I can't seem to access it through Surface.XAxis.DrawLabels or Surface.XAxes[i].DrawLabels though I can access the other four draw settings through both of those methods. The only method to access it seems to be by naming the x-axis in question and then calling it by name.
  • Andrew
    Ah got it, try casting the SciChartSurface.XAxis to AxisBase. I didn't realise the DrawLabels property was not on the interface.
  • rcannon
    Works perfectly once I figured out how to do that.
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.