Pre loader

Hide XAxis Labels

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

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 Burnett-Thompson
    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 Burnett-Thompson
    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.

Try SciChart Today

Start a trial and discover why we are the choice
of demanding developers worldwide

Start TrialCase Studies