SciChart® the market leader in Fast WPF Charts, WPF 3D Charts, and now iOS Charting & Android Chart Components

Welcome to the SciChart Community Forums!

Please use the forums below to ask questions about SciChart. Take a moment to read our Question asking guidelines on how to ask a good question and our support policy. We also have a tag=SciChart on Stackoverflow.com where you can earn rep for your questions!

Please note: SciChart team will only answer questions from customers with active support subscriptions. Expired support questions will be ignored. If your support status shows incorrectly, contact us and we will be glad to help.

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

  • VRueda
    HiCan you help me override your template from code? Shall i use xamlreader.parse? Or put xaml template in resources then find it by FindResource?
  • Yuriy
    Please, find useful information on this topic here: How to generate rollover marker template in code.Best regards, Yuriy
  • You must to post comments
Showing 1 result
Your Answer

Please first to submit.