How do I create graphs in ASP.NET MVC3?

10,011

Solution 1

You have a couple of options:

1. Create your own charting control

Start from scratch or build upon MVC 3's ChartHelper web helper to build your own charts.

2. Use an 'off the shelf' component

Telerik make a great set of controls for ASP.NET MVC, including a chart. Take a look at their demonstrations to see if it fits your needs.

Solution 2

Well, here are a few suggestions for you -

Open flash charts, Google charts, or you can refer to the following question. There are a few suggestions too.

Solution 3

I personally would go for a solution using http://www.jqplot.com/, a jquery plugin that allows you to create all kinds of graph (really, they have lots of them) basing on raw data. Your backend then has to just produce the data, and the drawing is done by the javascript. for examples see http://www.jqplot.com/tests/pie-donut-charts.php

Solution 4

I would take a look at a third party tool to get this done for you. I have used Telerik's MVC extensions in the past and had good luck with them. Depending on your licensing requirements, there is a free or pay version.

Solution 5

There are many ways to skin this cat, but one good option is using the Telerik MVC Chart extension.

Share:
10,011
CiccioMiami
Author by

CiccioMiami

Updated on July 27, 2022

Comments

  • CiccioMiami
    CiccioMiami almost 2 years

    I have to develop an ASP.NET MVC3 application in C# and Razor that has to gather data from a database, elaborate them and, according to the user's preference, display a graph based on user's preferences.

    For instance the user might want daily figures or monthly, he wants it in a histogram rather than a cake graph.

    I was wondering how can draw a graph in ASP.NET and even decide which kind of graph, etc. I guess they haven't created helpers for these tasks yet.