This is a migrated thread and some comments may be shown as answers.

Unknow Tooltip is apear in PolarAreaSeries

2 Answers 71 Views
ToolTip
This is a migrated thread and some comments may be shown as answers.
kity
Top achievements
Rank 2
kity asked on 19 Feb 2015, 05:29 PM
Can you simulate my problem?

It is show wrong tooltip when I set "PolarAreaSeries.PointTemplate" and IsHitTestVisible="True".

Before this week, my Tooltip was hide becouse IsHitTestVisible property was set to False by default Telerik style them.
Now when I set IsHitTestVisible to True show unknow ToolTip. I do not what to see any RadToolTip from telerik.

I want to use standart tool tip. How to remove this tooltip (see attache file) and to show only tooltip in my example, here:


            <telerik:RadPolarChart>
    
                 <telerik:PolarAreaSeries ItemsSource="{Binding BABACollection}" ValueBinding="Baba1" AngleBinding="Baba2" >                   
 
                    <telerik:PolarAreaSeries.PointTemplate>
                        <DataTemplate>
                           
                              <!-- Too see my tooltip must set in Grid IsHitVisible to True, but if I set it will apear some unknow tooltip. How to hide it?  -->      
                                <Grid IsHitTestVisible="True">
                                 
                                   <TextBlock Text="BR1"  />
                                       
                                                                                                                                                                                                                                                                                  <!-- ONLY This tooltip what to see  -->                                                
                                    <ToolTipService.ToolTip>
                                        <ToolTip >
                                            <StackPanel Orientation="Vertical">
                                                <TextBlock Text="{Binding Converter={StaticResource LabelConverter} , ConverterParameter='Value' }" Foreground="{StaticResource MaxPointIndicatorBrush}" />
                                                <TextBlock Text="{Binding Converter={StaticResource LabelConverter} , ConverterParameter='Angle' }" Foreground="{StaticResource MaxPointIndicatorBrush}" />
                                            </StackPanel>
                                        </ToolTip>
                                    </ToolTipService.ToolTip>
                                     
                                 </Grid>                       
                        </DataTemplate>                                                                   
                    </telerik:PolarAreaSeries.PointTemplate>               
                </telerik:PolarAreaSeries>
            </telerik:RadPolarChart>
             
------------
             
 public class LabelConverter : IValueConverter
    {
        public object Convert(object value, Type targetType, object parameter, System.Globalization.CultureInfo culture)           
        {
            if (parameter is string && parameter.ToString() == "Angle")
                return String.Format("Angle:{0}", Math.Round((value as PolarDataPoint).Angle, 2) );
            else if (parameter is string && parameter.ToString() == "Value")
                return String.Format("Value:{0}", Math.Round((double)(value as PolarDataPoint).Value, 2));
                             
            return String.Format("Angle:{0}|Value:{1}", Math.Round((value as PolarDataPoint).Angle, 2), Math.Round((double)(value as PolarDataPoint).Value, 2));
        }
 
        public object ConvertBack(object value, Type targetType, object parameter, CultureInfo culture)
        {
            throw new NotImplementedException();
        }
    }   
     
----------


...

​

2 Answers, 1 is accepted

Sort by
0
kity
Top achievements
Rank 2
answered on 19 Feb 2015, 05:30 PM
May be problem is in my styles, thems or just need to download lattes library becouse of that strange bug???
0
Martin Ivanov
Telerik team
answered on 23 Feb 2015, 01:43 PM
Hello,

I tested your code and everything works as expected. Also, I am not sure that I understand what exactly you mean by that there is a "unknown" tooltip. Can you please explain what is the actual and the expected result? As I can see you have a ToolTip control which has a StackPanel with two TextBlock elements in its Content. The result in the attached image is exactly what the ToolTip element should display. If you are referring the background and the border of the tooltip, note that those are coming from the ToolTip's element template. You can remove them by replacing the ControlTemplate of the ToolTip. Here is an example:
<ToolTipService.ToolTip>                                                              
    <ToolTip Background="Transparent" BorderThickness="0">
        <ToolTip.Style>
            <Style TargetType="ToolTip">
                <Setter Property="Template">
                    <Setter.Value>
                        <ControlTemplate TargetType="ToolTip">
                            <Border x:Name="Root" CornerRadius="2"
                                    BorderBrush="{TemplateBinding BorderBrush}"
                                    BorderThickness="{TemplateBinding BorderThickness}"
                                    Background="{TemplateBinding Background}"
                                    Padding="{TemplateBinding Padding}">
                                <ContentPresenter Content="{TemplateBinding Content}"
                                                  ContentTemplate="{TemplateBinding ContentTemplate}"
                                                  Cursor="{TemplateBinding Cursor}"
                                                  Margin="{TemplateBinding Padding}"/>
                            </Border>
                        </ControlTemplate>
                    </Setter.Value>
                </Setter>
            </Style>
        </ToolTip.Style>
         
        <StackPanel Orientation="Vertical">
            <TextBlock Text="{Binding Converter={StaticResource LabelConverter} , ConverterParameter='Value' }" Foreground="Red" />
            <TextBlock Text="{Binding Converter={StaticResource LabelConverter} , ConverterParameter='Angle' }" Foreground="Red" />
        </StackPanel>
    </ToolTip>
</ToolTipService.ToolTip>

Furthermore, the chart do not include an additional tool tip using the RadToolTip. I attached a sample project demonstrating your code snippet, can you please give it a try and let me know if I am missing something?

As a side note, the chartview suite has a built-in tooltip behavior which is not enabled by default. You can enable it by adding it in the Behaviors collection of the RadPolarChart. Also, keep in mind that this behavior doesn't work with ToolTip or RadToolTip elements, instead creates a content presenter and add it in the canvas that represents the render surface. Then set the Canvas.Top and Canvas.Left attached properties on the presenter to position it under the mouse.

Regards,
Martin
Telerik
 

Check out the Telerik Platform - the only platform that combines a rich set of UI tools with powerful cloud services to develop web, hybrid and native mobile apps.

 
Tags
ToolTip
Asked by
kity
Top achievements
Rank 2
Answers by
kity
Top achievements
Rank 2
Martin Ivanov
Telerik team
Share this question
or