8

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.

8 Answers 8

11

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.

Sign up to request clarification or add additional context in comments.

Comments

3

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.

Comments

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

Comments

3

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.

Comments

2

There are ChartHelpers in MVC3

Check this:

http://weblogs.asp.net/jalpeshpvadgama/archive/2011/08/30/chart-helpers-in-asp-net-mvc3.aspx

Comments

2

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

Comments

2

You could try one of the following C# libraries written to make it simpler to integrate Highcharts into ASP .Net

  1. Highcharts.Net (sample project)
  2. DotNet.Highcharts

Comments

1

I've used HighCharts before. This is a javascript charting library, but its easy to configure.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.