Tooltip of annotation doesn't working and tooltip of series is overlaid by Annotation
Hi, I'm trying to create annotation from C# but the tooltip of this annotation cannot work.

And one more thing is that my series is overlaid by this annotation
TextAnnotation textAnnotation = new TextAnnotation()
{
Text = "Buy",
FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
X1 = X1,
Y1 = Y1,
Foreground = color,
ShowToolTip = true,
ToolTipContent = new TextBlock()
{
Text = tooltip,
Foreground = color
}
};
SIGN IN To post a reply.
5 Replies
DS
Durgadevi Selvaraj
Syncfusion Team
January 2, 2018 09:30 AM UTC
Hi Hung,
Thanks for contacting Syncfusion Support.
Query 1: tooltip of this annotation cannot work.
We have analyzed the reported problem based on the provided code snippet and by default there is no content for tooltip and to display content inside tooltip you need to set TooltipContent as string for annotation as like in below code,
Code Snippet[C#]
|
TextAnnotation textAnnotation = new TextAnnotation()
{
Text = "Buy",
FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
X1 = 4,
Y1 = 860,
Foreground = new SolidColorBrush(Colors.Red),
ShowToolTip = true,
ToolTipContent = "This is TextAnnotation",
};
chart.Annotations.Add(textAnnotation); |
Please find the output screenshot,
You can refer our UG documentation link to know more about tooltip in chart Annotations,
Query 2: my series is overlaid by this annotation
We have already identified this problem in our Chart and this will be resolved in our upcoming Vol 1, 2018 release.
Also, we have prepared a workaround solution for this requirement by changing the order of tooltip canvas explicitly using custom chart class as shown in the below code,
Code Snippet[SfChartExt.cs]
|
public class SfChartExt : SfChart
{
private Canvas adorningCanvas;
public override void OnApplyTemplate()
{
adorningCanvas = GetTemplateChild("adorningCanvas") as Canvas;
base.OnApplyTemplate();
Canvas.SetZIndex(adorningCanvas, 1);
}
} |
Please find the output screenshot,
We have prepared a sample based on above requirements and it can be downloaded from the below link,
Sample :SfChart_Sample
Please let us know if you have any concerns.
Regards,
Durgadevi S
HN
Hung Nguyen
January 2, 2018 11:53 AM UTC
Thanks for your answer.
For Query 1:
I Think it's not because of tool tip content. I already set tool tip content, but it cannot be shown. I think the problem is the overlay problem that I cannot hover these annotation, that's why it will not show tool tip
DS
Durgadevi Selvaraj
Syncfusion Team
January 3, 2018 10:18 AM UTC
Hi Hung,
Thanks for the update.
Please let us know if you required any further assistance on this.
Regards,
Durgadevi S
MI
Mita
October 9, 2018 07:24 AM UTC
Hello Hung,
I am having the same problem with the annotation tooltip not appearing. I tried the solution from this thread, but no luck. Did you end up getting it to work?
-Mita
MK
Muneesh Kumar G
Syncfusion Team
October 9, 2018 09:25 AM UTC
Hi Mita,
Greetings from Syncfusion, we have analyzed your query and we would like to inform you that the overlaid problem resolved in our 2018 Vol 1 (16.1.0.24) release itself. Now the annotation tootip shown fine with mentioned TooTipContent as per the below code snippet. Here we don’t need the workaround solution for annotation tooltip.
Code snippet [C#]:
|
TextAnnotation textAnnotation = new TextAnnotation()
{
Text = "Buy",
FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
X1 = 4,
Y1 = 850,
Foreground = new SolidColorBrush(Colors.Red),
ShowToolTip = true,
ToolTipContent = "This is TextAnnotation",
ToolTipPlacement = ToolTipLabelPlacement.Top,
};
TextAnnotation textAnnotation1 = new TextAnnotation()
{
Text = "Buy",
FontSize = 12,
HorizontalAlignment = HorizontalAlignment.Center,
VerticalAlignment = VerticalAlignment.Top,
X1 = 5,
Y1 = 850,
Foreground = new SolidColorBrush(Colors.Red),
ShowToolTip = true,
ToolTipContent = "This is TextAnnotation",
ToolTipPlacement = ToolTipLabelPlacement.Top,
};
chart.Annotations.Add(textAnnotation);
chart.Annotations.Add(textAnnotation1); |
Make sure you have set ShowToolTip as true in annotation, please find the sample from the following location.
Sample: http://www.syncfusion.com/downloads/support/forum/135260/ze/Tooltip_Annotation2106841491.zip
Output:
Please let us know if you are still facing any issue in this.
Thanks,
Muneesh Kumar G.
SIGN IN To post a reply.
- 5 Replies
- 4 Participants
-
HN Hung Nguyen
- Dec 30, 2017 04:16 AM UTC
- Oct 9, 2018 09:25 AM UTC