Shokwave Shokwave - 1 year ago 192
ASP.NET (C#) Question

MSChart / Charts don't show tooltips

I have a dashboard page in which I am using various MSCharts.

I have a class defined for each one of these charts, in which I am defining Tooltips of the Series in that chart like below when I run through each chart class and define its Series properties.

Series[0].ToolTip = "Date = #VALX{d}\nTotal Qty Shipped = #VALY";

The problem I'm seeing is because there are multiple charts on the page, each with its own chart area. The only chart that shows a tooltip is the first chart that has one assigned to it. The other charts don't show anything even though similar code is run for them.

Why does only the first chart show a tooltip, and how can I get around this limitation?

Answer Source

I found the issue, I noticed while looking at the HTML generated that for each chart there was just a chart Image rendered with no ID assigned. Even though I had given the charts an ID in the ASPX page, I was using a User control class to pass in the properties and the ID was not being assigned on the back end. once I did that in the code behind (Chart.ID = "ChartName") and built it the Tooltips started showing up for each individual chart. Hope that helps someone else out that wasnt obvious to figure out!

Recommended from our users: Dynamic Network Monitoring from WhatsUp Gold from IPSwitch. Free Download