Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Showing tooltip on asp.net MS chart controls

Tags:

asp.net

I'm using Asp.net chart controls in order to display charts. I have a datatable which I'm directly binding to the control like this:

Chart1.DataSource = dtChart;
Chart1.DataBind();

Now, I would like to know how I can display a tooltip when mouse is hovered over each data points in the chart.

Thanks in advance.

like image 309
Derin Avatar asked Sep 13 '11 10:09

Derin


People also ask

How do I add a chart in tooltips?

To achieve this, we first add a table within the tooltip. The first column contains the categories ("women", "men"), and the second one contains the bars. In this second column, we then add HTML <div> tags and define the width of these boxes with our numerical columns.

What is tooltip in asp net?

The ASP.NET Tooltip is a pop-up component. It shows an information or message when you hover, click, focus, or touch an image, button, anchor tag, etc.,. The information displayed in the tooltip can include simple texts, images, hyperlinks, or custom templates.


1 Answers

You can set the tooltip in the Series like so:

<Series>
    <asp:Series ChartType="Line" Name="SeriesName" ToolTip="Value of X: #VALX Value of Y #VALY" >
    </asp:Series>
</Series>

This will show the values of the X and Y point when you mouse over it.

like image 144
jabroni Avatar answered Sep 23 '22 00:09

jabroni