Pre loader

Modifying the CursorModifier and RolloverModifier Tooltip ControlTemplate

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

1
0

Hi there

How to change crosshair’s and rollover’s tooltip, in particular lowest to low and highest to high?

  • You must to post comments
1
0

Hi,

You need to set RolloverLabelTemplate, CursorLabelTemplate properties. Here is the template which is used by default:

    <ControlTemplate x:Key="CursorLabelTemplate" TargetType="s:TemplatableControl">
        <Border Background="{Binding Path=CursorLabelBackgroundBrush,
                                     Source={z:Static Member=s:ThemeManager.ThemeProvider}}"
                BorderBrush="{Binding Path=CursorLabelBorderBrush,
                                      Source={z:Static Member=s:ThemeManager.ThemeProvider}}"
                BorderThickness="1"
                CornerRadius="5">

            <ItemsControl Margin="6" ItemsSource="{Binding SeriesData.SeriesInfo}" ItemTemplate="{StaticResource OhlcSeriesRolloverLabelTemplate}">
            </ItemsControl>
        </Border>
    </ControlTemplate>

    <!--  Template for the RolloverModifier tooltip to display AxisInfo collection (result of hit test)  -->
    <DataTemplate x:Key="OhlcSeriesRolloverLabelTemplate">

        <Grid>
            <Grid.RowDefinitions>
                <RowDefinition Height="Auto" />
                <RowDefinition />
            </Grid.RowDefinitions>
            <Grid.ColumnDefinitions>
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />
            </Grid.ColumnDefinitions>

            <TextBlock Grid.ColumnSpan="2"
                       HorizontalAlignment="Left"
                       Style="{StaticResource HintDataItemsStyle}"
                       Text="{Binding SeriesName}"
                       Visibility="{Binding SeriesName,
                                            Converter={StaticResource CollapseIfNullOrEmptyStringConverter}}" />

            <StackPanel Grid.Row="1">
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="Open" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="Highest" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="Lowest" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="Close" />
            </StackPanel>

            <StackPanel Grid.Row="1" Grid.Column="1">
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="{Binding OpenValue,
                                          StringFormat=\{0:0.000\}}" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="{Binding HighValue,
                                          StringFormat=\{0:0.000\}}" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="{Binding LowValue,
                                          StringFormat=\{0:0.000\}}" />
                <TextBlock HorizontalAlignment="Left"
                           Style="{StaticResource HintDataItemsStyle}"
                           Text="{Binding CloseValue,
                                          StringFormat=\{0:0.000\}}" />
            </StackPanel>
        </Grid>
    </DataTemplate>

You should modify this or create your own template, to override default one.

Hope this helps!

Best regards,
Yuriy

  • 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