Pre loader

How to create a Tooltip Template for the X-Axis tooltip in the Rollover Modifier


To whom this may concern:

I was successfully able to create a rollover modifier tooltip template for the actual data, as shown in the attached screenshot.

You can see the red arrow shows that the X-Axis tooltip is still the default style. I would like for it to be the same style as the tooltip templates circled in green.

I have tried using the AxisLabelTemplate dependency property, but the tooltips show up on the Y-Axes as well, and I don’t know how to bind it to the X-Axis Value.

Can you please advise?

Thanks kindly!

— Ari

  • You must to post comments
Best Answer

Hi ari,

In SciChart v4, this is now quite simple. From our RolloverModifier Documentation;

The RolloverModifier displays an optional XAxis Label which can be shown or hidden by changing the RolloverModifier.ShowAxisLabels property.

If you wish to change the Axis Label template, then you need to set the RolloverModifier.AxisLabelTemplate attached property on an Axis instance.

If you wish to change the container style for the Axis Label, then you need to set the RolloverModifier.AxisLabelStyle attached property on the Axis instance.

For example, the following code:

        <!-- Style applied to axis label, TargetType is AxisLabelControl -->
        <Style x:Key="AxisLabelStyle" TargetType="s:AxisLabelControl">
            <Setter Property="Background" Value="CornflowerBlue" />
            <Setter Property="BorderBrush" Value="Blue" />
        <!-- Item template. DataContext is AxisInfo type -->
        <DataTemplate x:Key="AxisLabelTemplate" DataType="s:AxisInfo">
            <StackPanel >
                <TextBlock Text="{Binding AxisId, StringFormat='{}AxisId : {0}'}" />
                <TextBlock Text="{Binding DataValue, StringFormat='{}Val : {0}'}" />

    <!-- Define the RolloverModifier XAxis Label style on the axis -->
        <s:NumericAxis s:RolloverModifier.AxisLabelStyle="{StaticResource AxisLabelStyle}" s:RolloverModifier.AxisLabelTemplate="{StaticResource AxisLabelTemplate}"/>
        <s:NumericAxis />
            <s:RolloverModifier />

Best regards,

  • Ari Sagiv
    Yep, I had updated to SciChart v. 4 and figured that out :-) Thank you!
  • Andrew Burnett-Thompson
    Great! sounds like the new API is intuitive, which is what we wanted!! :)
  • 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