Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.Net Chart Control with MVC3 Razor

Tags:

asp.net-mvc

I am using ASP.Net MVC3 and the MS chart controls to draw a pie chart.

It seems I have to set an IMG control with the source set to an action controller. However this looses the possibility of being able to 'click' on the image and get a redirect to another page with the relevant segment that has been clicked.

Can anyone help?

Thanks

like image 374
Dean Avatar asked Feb 11 '11 14:02

Dean


1 Answers

This tutorial - here. Should help you, however in doing this it will add a viewstate to your views. It basically adds runat="server" to your page so treats it like any normal webforms page and violates the MVC principal.

If your bothered about that then there are a number of javascript charts that can be used - the Google chart api is a good start.

like image 180
lancscoder Avatar answered Oct 11 '22 12:10

lancscoder