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

0
0

When I have cursor tooltips enabled, showing the y-values, they display properly until the y-valuse for the 1st series is below the axis y-min. Below the tooltip y-values are showing correctly
Tootip displaying correctly

If I move the mouse to the left, below 25 Hz, the tooltip disappears as below.
How can I correct this?

Missing tooltip
Thanks,
Robert

  • You must to post comments
0
0

Hi Robert,

At a guess, I think your tooltip is too large for the screen, so SciChart tries to place it, but cannot (there is not enough space either to the left or the right of the cursor).

If you template your tooltip and use a smaller font size, does it display all? How to apply a Rollover Tooltip Template for info on how to style the RolloverModifier. If this works then we can look in to how to improve the API. It shouldn’t hide the tooltip but should show it partially off-screen.

Lovely graph by the way 🙂

Best regards,
Andrew

  • You must to post comments
0
0

Hi Andrew,
I am pretty certain that it has nothing to do with the not having enough space.
Currently I have:

enter image description here

The tool tip is no longer changing its y-location as you mouse left-right. But, when the y-value of the 1st series is a bit lower than the chart min, it still disappears, like this:

enter image description here

In my case, I think having the tool tip move about with the chart isn’t desirable. I am currently trying to have a fixed area for x-y display. In this case I am using a RolloverModifier. So far I have this:

enter image description here

I used the example from RealTimerCursors.xaml. What I need to do is position the y-values below the legend and perhaps remove the colors, etc. Or combine with the legend and its checkboxes.
I would like to know how to remove the fat y-crosshair.

My code so far is below.
Thanks,
-Robert

  <s:SciChartSurface.Annotations>
            <s:CustomAnnotation CoordinateMode="Relative" X1="0.01" Y1="0.02" Content="{Binding SeriesData, ElementName=rolloverModifier}" HorizontalAnchorPoint="Left" VerticalAnchorPoint="Top">
                <s:CustomAnnotation.ContentTemplate>
                    <DataTemplate>
                        <!-- Define a panel to display rollover results -->
                        <Border Grid.Row="1" BorderBrush="#55000000" BorderThickness="2" Background="#77FFFFFF" VerticalAlignment="Top" HorizontalAlignment="Left" Padding="5">
                            <ItemsControl DataContext="{Binding}" ItemsSource="{Binding SeriesInfo}">
                                <ItemsControl.ItemTemplate>
                                    <!-- Template will be instantiated for each SeriesInfo in the RolloverModifier.SeriesInfo collection -->
                                    <!-- See the SciChart API Documentation for SeriesInfo types, there is a different type for OHLC and XyzDataSeries for instance -->
                                    <!-- SeriesInfo is the datacontext for the below. Note you can access the original RenderableSeries via SeriesInfo.RenderableSeries -->
                                    <DataTemplate>
                                        <Grid HorizontalAlignment="Left">
                                            <Grid.ColumnDefinitions>
                                                <ColumnDefinition />
                                                <!--<ColumnDefinition />
                                                <ColumnDefinition />
                                                <ColumnDefinition />-->
                                            </Grid.ColumnDefinitions>

                                            <!--<Ellipse Fill="{Binding SeriesColor, Converter={StaticResource ColorToBrushConverter}}" Width="9" Height="9" Margin="3"/>-->

                                            <!--<TextBlock Grid.Column="1" Text="{Binding SeriesName}" Width="90" Style="{StaticResource tbStyle}"/>-->

                                            <!-- When binding to XValue, YValue of type IComparable, StringFormat is mandatory due to a -->
                                            <!-- XAML bug that cannot convert IComparable to text, even though underlying type is double -->
                                            <!--<StackPanel Orientation="Horizontal" Grid.Column="2">
                                                <TextBlock Text="X: " Style="{StaticResource tbStyle}"/>
                                                <TextBlock Text="{Binding XValue, StringFormat=\{0:0.00\}}" Style="{StaticResource tbStyle}"/>
                                            </StackPanel>-->
                                            <StackPanel Orientation="Horizontal" Grid.Column="0">
                                                <!--<TextBlock Text="Y: " Margin="3" Style="{StaticResource tbStyle}" />-->
                                                <TextBlock Text="{Binding YValue, StringFormat=\{0:0.00\}}" FontSize="10" Foreground="{Binding SeriesColor, Converter={StaticResource ColorToBrushConverter}}"/>
                                            </StackPanel>

                                        </Grid>
                                    </DataTemplate>
                                </ItemsControl.ItemTemplate>
                            </ItemsControl>
                        </Border>
                    </DataTemplate>
                </s:CustomAnnotation.ContentTemplate>
            </s:CustomAnnotation>
        </s:SciChartSurface.Annotations>
        <s:SciChartSurface.ChartModifier>         

            <s:ModifierGroup>
                <s:RolloverModifier x:Name="rolloverModifier" ShowAxisLabels="False" UseInterpolation="False" />
                <s:LegendModifier  ShowLegend="True" Orientation="Vertical" Margin="0,0,10,0" LegendPlacement="Left"/>

                <s:SeriesSelectionModifier>
                    <s:SeriesSelectionModifier.SelectedSeriesStyle>
                        <Style TargetType="s:BaseRenderableSeries">
                            <Setter Property="StrokeThickness" Value="3"/>
                        </Style>
                    </s:SeriesSelectionModifier.SelectedSeriesStyle>
                </s:SeriesSelectionModifier>
                <s:YAxisDragModifier/>
                <s:XAxisDragModifier/>
                <s:CursorModifier   
                    ShowAxisLabels="True" 
                    ShowTooltip="True" 
                    ShowTooltipOn="MouseLeftButtonDown"
                    UseInterpolation ="False"
                    FontSize="8" 
                    />
                <!--MouseMove="CursorModifier_MouseMove"-->
            </s:ModifierGroup>
        </s:SciChartSurface.ChartModifier>
  • You must to post comments
0
0

Hi Robert,

Sounds like you are on the right track. To style or remove the rollover line, please have a look at the article Adding TImeSeries Tooltips with the RolloverModifier and scroll down to the section Styling the Rollover Line.

To move the rollover cursor elements below the legend, well, you could actually combine the legend & rollover info. Why not template the Rollover readout to display the info about the series including the series name, line style and visibility checkbox?

Basically the LegendModifier and RolloverModifier just output a series of ViewModels that you can consume and the SciChartLegend is simply an ItemsControl with an ItemTemplate. You should be able to achieve quite a deep level of customisation given a little work.

Take a look at SeriesInfo – The Series ViewModel for Legends, Tooltips, Rollovers and SciChartLegend ItemsPanel and ItemsTemplate for some ideas.

Hope this helps!

Best regards,
Andrew

  • You must to post comments
0
0

It appears that I cannot move the annotations outside the chart area. I’d like them positioned below the legend.
https://www.scichart.com/questions/question/can-annotations-be-placed-outside-of-the-chart-area

But I see you answered my post while I was typing, so I’ll give your suggestion a try.

  • You must to post comments
0
0

I’m getting closer. I have

enter image description here

I added the checkboxes to enable the series, like the LegendModifier does by default. But I have no idea how to bind it.
I’ll look through the examples for a clue.

  • You must to post comments
0
0

Thank you. I bound the checkbox to the bool IsVisable:

       <CheckBox Grid.Column="0" IsChecked="{Binding Path=IsVisible}"/>

This works, except the checkboxes that are checked disappear while moving the mouse.
They reappear when you stop moving the mouse.
-Robert

  • You must to post comments
0
0

I attached a simple project that shows the flickering checkboxes.
enter image description here

Attachments
  • You must to post comments
Showing 7 results
Your Answer

Please first to submit.