Microsoft Charting, MVC 3 and Razor

Victor picture Victor · Jan 19, 2011 · Viewed 25.3k times · Source

Related to This topic I wonder if anyone has made the Microsoft Charting library working with Asp MVC 3 and Razor.

I know about the new chart helper introduced, but since that is very limited that is not really an option.

To create an action method that returns an image is also easy enough, but since all interactivity breaks down (even just simple tooltips for the bars in a bar chart) this method has several limitations.

This example is probably the most helpful article I have found, but I still cant get a single easy chart working even though it does work when rendering the image only in an action method. Also I have got the samples working fine under .net 4, but obviously those arent MVC samples.

SO - has anyone got Microsoft charting working fully in Asp MVC 3 with Razor and could post a link to a complete solution?

Answer

Sarath picture Sarath · Feb 28, 2011

If it is tool tip and drill down you are looking for then here is a sample. I tried and worked as a charm for me. You need to have ImageMap linked with your image to have interactivity.

MVC Charts with Interactivity