Charts in MVC3

 

So you want to draw a chart in MVC and don’t know where to start?

Step 1) Create a new MVC3 project

Step 2) Open NuGet and add a library reference to “microsoft-web-helpers”

image

 

image

Step 3) Change your action method to create a new chart and write it to the response stream

 

image

 

Result)

image

Step Additional )

You could return a partial view and even call it from Ajax if you wanted, you could just return Json and use a client side vector graphics library.
Or you would create your own html helpers / function to make life easier. (many ways to skin a cat).

Comments are closed