MSChart / Asp.net Charts don't show tooltips

旧时模样 提交于 2019-12-04 05:27:20

问题


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?


回答1:


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!



来源:https://stackoverflow.com/questions/9456506/mschart-asp-net-charts-dont-show-tooltips

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!