Hi,
I’m wondering, if there any chance to hide or change the font size of XAxis label numbers.
Thanks
- Amir asked 11 years ago
- You must login to post comments
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
- Andrew Burnett-Thompson answered 11 years ago
-
Thanks Andrew It works.
-
In SciChart's newest version, is there a way to programmatically hide the x axis labels on a datetime axis?
-
Hi there, yes there is, from the post above:
you can set XAxis.DrawLabels=false to hide the X-labels
-
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.
-
Ah got it, try casting the SciChartSurface.XAxis to AxisBase. I didn't realise the DrawLabels property was not on the interface.
-
Works perfectly once I figured out how to do that.
- You must login to post comments
Please login first to submit.