Pre loader

How to customize the tooltip in the mode of CursorModifier

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


Please see the attached screen snapshot. My apps is based on the example ScriTrader. I have about 30 series on the chart. In the CursorModifier mode. I want to customize the tooltip to achieve:

1) only the FastCandlestickRenderableSeries shows the tooltip
2) the string format is 0.00000 instead of the default value 0.000
3) other series won’t whow tooltip

  • You must to post comments
Best Answer

Update: SciChart v4

The SciChart v4 Documentation now has a topic on styling the CursorModifier Tooltips, Lines and Axis Labels. You can see this here:

> How to style the CursorModifier Tooltips

Also, you can learn how to style the CursorModifier Tooltips and Axis Labels in the following example:

> Styling CursorModifier Tooltips WPF Chart Example

enter image description here

  • You must to post comments

Hi there,

Thanks for your inquiry. Actually, to show a tooltip for the Ohlc series, you could set IsSelected to “True” on the series and SourceMode to “SelectedSeries” on the Cursor modifier. Or you could override the IsSeriesValid method and return “True” for the FastCandlestickRenderableSeries only.

Unfortunately, the string format is hard-coded in the default style, so you should create a new DataTemplate for Ohlc data and apply it via SeriesInfoTemplateSelector, also setting templates for other series types to an empty DataTemplate. FYI, we improved this behavior in the newest v3.2 build (internal) and it will be possible to change string format setting the CursorTextFormatting property or a LabelProvider on an axis.

Please take a look at the xaml piece below and let us know if it has the desired behavior:

<UserControl x:Class="Abt.Controls.SciChart.Example.Examples.IWantTo.CreateMultiseriesChart.CandlestickWithLinesView"


    <!-- The style for TextBlocks appearing in a tooltip -->
    <Style x:Key="HintDataItemsStyle" TargetType="TextBlock">
        <Setter Property="Foreground" Value="{markupExtensions:ThemeBinding Path=CursorLabelForeground}" />
        <Setter Property="FontWeight" Value="Bold" />
        <Setter Property="FontFamily" Value="Arial" />
        <Setter Property="FontSize" Value="13" />
        <Setter Property="Margin" Value="3,2,2,2" />

    <!-- The template, which determines appearance of the tooltip for Ohcl data -->
    <DataTemplate x:Key="OhlcSeriesRolloverLabelTemplate" DataType="s:OhlcSeriesInfo">
                <RowDefinition Height="Auto" />
                <RowDefinition />
                <ColumnDefinition />
                <ColumnDefinition Width="Auto" />

            <TextBlock Grid.ColumnSpan="2"
                   Style="{StaticResource HintDataItemsStyle}"
                   Text="{Binding SeriesName}" />

            <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 Grid.Row="1" Grid.Column="1">
                <TextBlock HorizontalAlignment="Left"
                       Style="{StaticResource HintDataItemsStyle}"
                       Text="{Binding OpenValue,
                                      StringFormat=\{0:0.0000\}}" />
                <TextBlock HorizontalAlignment="Left"
                       Style="{StaticResource HintDataItemsStyle}"
                       Text="{Binding HighValue,
                                      StringFormat=\{0:0.0000\}}" />
                <TextBlock HorizontalAlignment="Left"
                       Style="{StaticResource HintDataItemsStyle}"
                       Text="{Binding LowValue,
                                      StringFormat=\{0:0.0000\}}" />
                <TextBlock HorizontalAlignment="Left"
                       Style="{StaticResource HintDataItemsStyle}"
                       Text="{Binding CloseValue,
                                      StringFormat=\{0:0.0000\}}" />

    <!-- Empty data template for other series -->
    <DataTemplate x:Key="EmptyTemplate" />

    <!-- the TemplateSelector for the CursorModifier below -->
    <s:SeriesInfoTemplateSelector x:Key="OhlcSeriesInfoTemplateSelector" 
                                  DefaultTemplate="{StaticResource EmptyTemplate}" 
                                  OhlcSeriesTemplate="{StaticResource OhlcSeriesRolloverLabelTemplate}" />


<s:SciChartSurface x:Name="sciChart" s:ThemeManager.Theme="Chrome">

        <!-- Candlestick bodies now support gradients as well as solid colours -->
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#55002200" />
                    <GradientStop Offset="1" Color="#FF00AA00" />
                <LinearGradientBrush StartPoint="0,0" EndPoint="0,1">
                    <GradientStop Offset="0" Color="#55441111" />
                    <GradientStop Offset="1" Color="#FFFF0000" />
        <s:FastLineRenderableSeries SeriesColor="#FF1919" />
        <s:FastLineRenderableSeries SeriesColor="#1964FF" />
        <s:FastLineRenderableSeries SeriesColor="#FF9B27" />

        <s:CategoryDateTimeAxis GrowBy="0.0, 0.2" />

        <s:NumericAxis GrowBy="0.1, 0.1" />

            <s:CursorModifier ShowTooltip="True" TooltipLabelTemplateSelector="{StaticResource OhlcSeriesInfoTemplateSelector}"/>


Best regards,

  • chunxi
    This solved my problem. Many thanks Yuriy!
  • RTrade A
    Yuriy, In SeriesInfoTemplateSelector what is the name for template for FastColumnRenderableSeries? Now I have to create DataTemplate for it with XySeriesInfo DataType and set in TemplateSelector to DefaultTemplate.
    • Guest
    • 9 years ago
    • 1
    Hi, DefaultTemplate is used for FastColumnRenderableSeries. You should inherit SeriesInfoTemplateSelector, define your own property and check for FastColumnRenderableSeries in the SelectTemplate method override, returning appropriate DataTemplate. Does it make sense?
  • You must to post comments
Showing 2 results
Your Answer

Please first to submit.