I’ve looked for a solution to this, and while I can see how to do it with Silverlight, I can’t work it out for ASP.NET. I’ve generated a simple bar chart using Microsoft’s Chart Tools, but there are a large number of columns added so the labels on the x axis are not clear, and only show for a few of the columns.
The code I’ve used to generate the chart is:
public ActionResult ChartUserTotals() {
var data = new ArrayList {};
foreach (var user in org.Users) {
data.Add(new { X = user.FullName, Y = UserTotal });
}
new Chart(400, 300, ChartTheme.Blue)
.AddTitle("User Totals")
.DataBindTable(data, "X")
.SetYAxis("Totals")
.Write("png");
return null;
}
And in my view:
<img src='@url.Action("ChartUserTotals", "Dashboard")' alt="User Totals"/>
Does anyone know how I can display the label values on column mouseover?
I know I asked this ages ago, but I thought I should mention that the given answer (using the title attirbute) isn’t what I was looking for (since the tooltip needs to differ depending on which column the user is hovering over), however I solved this a different way. I ended up using the jQuery plugin HighCharts (which is a really easy, not to mention beautiful, jQuery plugin). Not hugely MVC friendly though, needed to push a C# array into javascript through Razor, but it did work. For anyone with a similar problem, this is what I’d reccommend