[RESOLVED]Charts control api in MVC C#

Hi All,

My requirement to display data using charts control. Is it possible to display the data in charts control (All type of charts eg, Combination of line and bar charts, line charts, bar charts) using MVC razor view. My organization don’t want to use any third
party(Paid api) for visualization.

Please suggest me the the right api(free version) that could help me show all kind of charts in mvc

Thanks in advance

You can use the Microsoft charting library. I blogged about it some time ago: http://www.mikesdotnetting.com/Article/115/Microsoft-Chart-Controls-to-PDF-with-iTextSharp-and-ASP.NET-MVC

There are some samples available here: http://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

Mikesdotnetting

You can use the Microsoft charting library. I blogged about it some time ago: http://www.mikesdotnetting.com/Article/115/Microsoft-Chart-Controls-to-PDF-with-iTextSharp-and-ASP.NET-MVC

There are some samples available here: http://code.msdn.microsoft.com/Samples-Environments-for-b01e9c61

Thanks Mikesdotnetting for shared this useful link. I want one clarification: Can we create combination of charts(Line and Bar) in single charts using Microsoft charting library?

I don’t know. You can check the link I provided for samples.

Hi info2ambrish,

As far as I know, there isn’t the combination chart in Microsoft chart library.

For combination chart, you could refer to this article:

# Combination Chart

http://mvc.syncfusion.com/demos/ui/chart/ChartType/CombinationChart

Best Regards

Starain Chen

Starain chen – MSFT

For combination chart, you could refer to this article:

# Combination Chart

http://mvc.syncfusion.com/demos/ui/chart/ChartType/CombinationChart

That’s a paid for component.

I saw a "guy-at-work" create, from scratch a charting server in about 4 days just last week.  He used HighCharts and had no experience with charting before
this. 

I used MSFT’s charting components for years and found it to be quite complex ,but that’s just my opinion.

i checked out high charts its simply superb, it is much like google charts, except that google dont allow you to download javascript library and the client needs to have internet connection inside corporate VPNS to work.

Hi Ambrish,

We have used JQPlots  http://www.jqplot.com/ in our application , its A Versatile and Expandable jQuery Plotting Plugin

its easy to use. you can refer this link. - http://www.jqplot.com/tests/

 

Thanks for reply.

I gone through the shared link and It was very useful  but In my organization don’t want to buy any third party library for combination chart. They are forcing me to do the combination chart using Microsoft charts control only. Please let me know any free
library, that I can use in my project to get the combination charts.

Thanks in advance

Hi info2ambrish,

Since there isn’t that feature in the Microsoft chart control, I suggest that you could submit the feature request to here:
http://aspnet.uservoice.com/forums/41199-general-asp-net, after you submit it, please post the link here which will benefit to others who has the similar issue.

On the other hand, I don’t find any free library to support combination chart.

Best Regards

Starain Chen

Hi Starain Chen,

Is it possible to create combination charts using jQuery or JavaScript or Ajax Chart Control?

Kindly let me know any alternate way to solve my issue……..I don’t know What I should do at this point of time…..They just forcing me do and they are saying it is possible to do using MS charts control but they are not providing any code snip
for this. Upper management saying we have done it long time back, Search it and do it ASAP.

Thanks in advance

Hi info2ambrish,

Base on my test, I found that we can achieve combination charts by using MS charts!

We just need add multiple series to the chart.

This is the sample code:

 

@{
    ViewBag.Title = "Index";

    var myChart = new Chart(width: 600, height: 400)
        .AddTitle("test")
        .AddSeries(
        name: "Username: Davolio",
        xValue: new[] { "One", "Two", "Three", "Four", "File", "Six" },
        yValues: new[] { "2", "6", "4", "5", "3", "8" });

    myChart.AddSeries(
        name: "new series",
        chartType: "Spline",
        xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave","Star" },
         yValues: new[] { "2", "6", "4", "5", "3","10" });
    myChart.Write();
}

Best Regards

Starain Chen

Starain chen – MSFT

Hi info2ambrish,

Base on my test, I found that we can achieve combination charts by using MS charts!

We just need add multiple series to the chart.

This is the sample code:

 

@{
    ViewBag.Title = "Index";

    var myChart = new Chart(width: 600, height: 400)
        .AddTitle("test")
        .AddSeries(
        name: "Username: Davolio",
        xValue: new[] { "One", "Two", "Three", "Four", "File", "Six" },
        yValues: new[] { "2", "6", "4", "5", "3", "8" });

    myChart.AddSeries(
        name: "new series",
        chartType: "Spline",
        xValue: new[] { "Peter", "Andrew", "Julie", "Mary", "Dave","Star" },
         yValues: new[] { "2", "6", "4", "5", "3","10" });
    myChart.Write();
}

Best Regards

Starain Chen

Thanks a lot for this post. This is really helped me lot.

Leave a Reply