Chart Series ToolTip

Hello,
I can not code the tooltip dynamically insert in a Chart series itself dynamically insert.

To sum up, I add a dynamic series in my chart in code behind and this series, I must add a tooltip for the values ​​of my curve.

In the guide we find this:






it is exactly what i would but i can not code this in code behind.


i have this actually:
Chart.Areas[0].Series[x].DataSource = myData;
Chart.Areas[0].Series[x].BindingPathX = "Date";
Chart.Areas[0].Series[x].BindingPathY = new List() {"Value"};

ToolTip myToolTip = new ToolTip();
Binding c = new Binding();

c.source = Chart.Areas[0].Series[x];
c.Path = new PorpertyPath("currSegment.DataPoint.X");
myToolTip.SetBinding(ToolTip.ContentProperty, c);
myToolTip.Template = ...
ToolTipService.SetToolTip(Chart.Areas[0].Series[x], myToolTip);



sorry for my bad english

Thanks in advance



1 Reply

MP Michael Prabhu M Syncfusion Team September 9, 2011 05:17 AM UTC

Hi Nicolas,

Thanks for using Syncfusion products.

We have analyzed your requirement, your requirement can be achieved by creating tooltip in MouseEnter event for chartseries as in below code snippet.

Code snippet[c#]:

void series_MouseEnter(object sender, ChartMouseEventArgs e)
{
mytooltip.Content = Convert.ToString(chart.Areas[0].Series[0].currSegment.DataPoint.Y);
mytooltip.IsOpen = true;
ToolTipService.SetToolTip(chart.Areas[0].Series[0], mytooltip);
}

Based on your requirement we have created and attached a sample.

Please let us know if you have any queries.

Thanks,
Michael Prabhu.



Tooltip_781d20dd.zip

Loader.
Up arrow icon