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.
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.
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.
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.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With