Version

Styling Axis Label

The AxisLabel object displays the time of each event in a time series. You can use styles to change the appearance or format of the value displayed in the Axis Label. For more information on formatting the Axis Label, see About Formatting xamTimeline.

The following xaml code shows how to style the Axis Label to change the color and font size of the text.

In XAML:

    <UserControl.Resources>
        <!-- Styles for Axis -->
        <Style x:Key="rscAxisLabelStyle" TargetType="ig:AxisLabel">
            <Setter Property="Template">
                <Setter.Value>
                    <ControlTemplate TargetType="ig:AxisLabel">
                        <TextBlock x:Name="TextBlockElement" Foreground="Red"
                                   FontWeight="Bold" FontSize="15"
                                   Text="{TemplateBinding FormattedText}" />
                    </ControlTemplate>
                </Setter.Value>
            </Setter>
        </Style>
    </UserControl.Resources>
    <Grid x:Name="LayoutRoot" Background="White" >
        <ig:XamTimeline x:Name="xamTimeline"
                             Width="1000" Height="480" Margin="25">
           <!-- Set Axis properties -->
            <ig:XamTimeline.Axis>
                <ig:NumericTimeAxis Minimum="-3200" Maximum="2600"
                                      AutoRange=" Unit="400"
                                      ShowLabels="True" ShowThumb="True"
                                      LabelStyle="{StaticResource rscAxisLabelStyle}"
                                      ShowLabelsInPreview="True"/>
            </ig:XamTimeline.Axis>
            <!-- TODO: Add Numeric/Date Series ... -->
        </ig:XamTimeline>
    </Grid>
XamTimeline Style Axis Label 01.png