Click here to Skip to main content
15,868,016 members
Articles / Web Development / ASP.NET

Comparing .NET chart solutions for web-applications

Rate me:
Please Sign up or sign in to vote.
4.88/5 (24 votes)
5 Aug 2014CPOL7 min read 61.1K   35   25
In this article collected most popular freeware/commercial solutions for data visualization in .NET

Introduction

After long years passed releasing ASP .NET, community amassed a whole banch of various solutions for data visualization for any taste and budget: free, commecial, self-developed etc. They all work in different way, have no interoperable interfaces, use different architecture. performance and layout. So looking for the best choise developer often stops on first more or less suitable, because he has not enough time for complete investigation.

This article tries to collect all available solutions in one place, compare their performance, provide short summary and supply simplest usage examples. Also, it introduces quick guide which explains technical implementation of test application, since it may be interesting for beginners.

Background

Some time ago I had been assigned to the task - re-work existing chart solution for RDLC report, because it worked too slow on a large amount of data. It was expected, that newly introduced solution should be separated from RDLC, and just render image to file or stream, so it can be used elsewhere. I needed to investigate existing solutions and examine them for speed, flexibility, customization etc. Most of these properties are immeasurable, except of speed. So working on the task, I compared performance of most popular free/commercial solutions and want to share results with public

Quick overview

Technically I run each solution on fixed amount of data with random values. To minimize inaccuracy it had been done in several iterations. Default settings for each chart weren't changed. I agree that it may not be completelly reliable approach, but I saw no alternative way.

Here is the list of chart solutions that were included to the overview:

Not to waste your time, I bring performance test results right here:

Solution License Iteration amount Total time(sec) Averege time(sec)
1 Zed Graph Free 10 2.281 0.2281
2 Dislin  Free 10 2.591 0.2591
3 ChartDirector Commercial 10 3.604 0.3604
4 NPlot Free 10 3.846 0.3846
5 Oxy Plot Free 10 4.091 0.4091
6 Web Chart  Free 10 4.305 0.4305
7 Microsoft Chart Controls Free 10 4.353 0.4353
8 Chart FX Commercial 10 5.3 0.53
9 ILNumerics Commercial 10 6.079 0.6079
10 DevExpress Commercial 10 7.614 0.7614
11 dotnetCharting Commercial 10 7.684 0.7684
12 Tee charts Commercial 10 10.004 1.0004
13 Telerik charts Commercial 10 11.496 1.1496
14 Infragistic Commercial 10 12.113 1.2113
15 Open minded plot Free 10 13.034 1.3034
16 Google Sharp charting Free 10 14.12 1.412

Testing was conducted on PC with next configurations: Intel Core I5 3.10 GHz, 8gb ОЗУ, NVIDIA GeForce GT 520, Windows 7 x64. Results may be different on your PC.

I try not to give my own opinion about each particular solution, cause it may be nonobjective or I just lack experience in using it. Only general information:

  • DisLin - cross-platform (UNIX, Linux, FreeBSD, OpenVMS, Windows, Mac OSX и MS-DOS), fast, has ports to numerous languages (C, C++, Fortran 77, Fortran 90, Perl, Python, Ruby, Tgl, GCL, C#).Image 1
  • Google Chart Sharp - C# wrapper on Google Chart API. Has limitation on 50000 calls per day. May work slow due to network bandwidth.                                  Image 2
  • Microsoft Chart Controls - official native chart solution from Microsoft. As plus - widely used, and well-documented.                                                       Image 3
  • NPlot - open-source. Works pretty fast comparing to other solutions.Image 4
  • OxyPlot - cross-platform, open-source. Widely used comparing to other free some. Has controls for WPF, Silverlight, Windows Phone, Windows 8 Metro, Xamarin.Image 5
  • ZedGraph - fastest solution (on default installation). Open-source. Has controls for ASP .NET and Windows Forms.                                                                                                                                Image 6
  • WebChart - old and closed (as far as I can see) solution. But still stable and may be helpfull for someone.Image 7
  • OpenMinded - 'dark horse' of my classification. Slow and little-known, but looks pretty.Image 8
  • Chart Fx - commecial solution. According to documentation supports .NET, Java, HTML5, COM, WPF, Silverligth, Sql Reporting Services.                                                                                Image 9
  • DevExpress - widely-spread commercial solution. Hold huge amount of controls. Supports WinForms, ASP.NET, ASP MVC, WPF, Windows Forms, Silverlight, Windows 8. The only thing - I did not manage to render web chart to the image, so I used WinForms control. Works slower than biggest part of other solutions.                               Image 10
  • Telerik - another widely-spread commercial solution that has whole banch of various controls for cross-platform development. Use different technologies, one of the slowest solution.Image 11
  • Chart director - fast commercial solution. Has ports to  .NET, Java, ASP, COM, VB, PHP, Perl, Python, Ruby, ColdFusion, C++.                                                   Image 12
  • ILNumerics - mathematic library developed exclusiverly for .NET. Commercial. Medium performance.Image 13
  • Tee chart - commercial solution. Has ports to Java, ActiveX / COM, PHP and Delphi VCL / FireMonkey. Less than average performance.                                         Image 14
  • dotnetCharting - commercial solution. Has easy programming interface and rich functionality.               Image 15
  • Infragistics - commercial solution. Nice and easy-to-use, but relatively slow.Image 16

As you see, free solutions often works faster than their commercial contenders, but may have less customization parameteres and of cource no official support. 

Implementation details

My goal was to hide implementation of each chart solution under some abstract entity, so I could measure performance programmatically. Also, since I can't ship commercial solutions because of license, I needed some architechture that let me include them in project dinamically. 

This goal was achieved by taking out each 'adapter' for chart solution into separate assembly. Generally, component diagramm looks like on the image bellow:

Image 17

All base classes and interfaces introduced in ChartingCore.dll assembly, to let web application and particular adapters to share code. It contains definitions for next interfaces (and appropriate base classes):

C#
public interface IChartFactory
{
    IChartAdapter GenerateChart(ChartParameters parameters);
    string ChartTypeName { get; }
    string DownloadLink { get; }
    SolutionType SolutionType { get; }
    Guid Id { get; }
}
C#
    public interface IChartAdapter
    {
        Image CreateChartImage();
        IChartFactory Owner { get; set; }
    }
C#
    public enum SolutionType
    {
        Free,
        Commercial,
        Any
    }

Than, each assembly for every solution must impelement this interfaces. E.g., as it was done for Google Chart Sharp:

C#
/// <summary>
/// Apache License 2.0
/// Official link - https://code.google.com/p/googlechartsharp/
/// </summary>
public class GoogleSharpAdapter : BaseChartAdapter
{
    public GoogleSharpAdapter(ChartParameters parameters)
        : base(parameters)
    {
    }

    protected override Image DoCreateChartImage()
    {
        var chart = new LineChart(Parameters.ChartWidth, Parameters.ChartHeight);
        chart.SetData(Parameters.SeriaData.Select(t => new float[]{t.Key, t.Value}).ToList());
        var webClient = new WebClient();
        byte[] imageBytes = webClient.DownloadData(chart.GetUrl());
        return new Bitmap(new MemoryStream(imageBytes));
    }
}
C#
/// <summary>
/// Open Source https://code.google.com/p/googlechartsharp/
/// </summary>
public class GoogleSharpChartFactory: BaseChartFactory
{
    protected override IChartAdapter DoGenerateChart(ChartParameters parameters)
    {
        return new GoogleSharpAdapter(parameters);
    }

    public override string ChartTypeName
    {
        get { return "Google Sharp charting"; }
    }

    public override string DownloadLink
    {
        get { return "https://code.google.com/p/googlechartsharp/"; }
    }

    public override SolutionType SolutionType
    {
        get { return SolutionType.Free; }
    }
}

Then I used Spring Framework for .NET to load assemblies to the web application dinamically. In this application, information about required assemblies and classes located at SpringContext.xml file:

XML
<?xml version="1.0" encoding="utf-8" ?>
<objects xmlns="http://www.springframework.net">
    <object name="CurrentFactoriesCollection" type="FreeChartTools.FactoriesCollection, FreeChartTools, Version=1.0.0.0, Culture=neutral">
        <constructor-arg>
            <list element-type="ChartingCore.IChartFactory, ChartingCore, Version=1.0.0.0, Culture=neutral">
                <!--Free && Open source solutions-->
                <ref object="DisLinChartingFactory"/>
                <ref object="GoogleSharpChartingFactory"/>
                <ref object="MsChartingFactory"/>
                <ref object="NPlotChartFactory"/>
                <ref object="OxyPlotChartFactory"/>
                <ref object="WebChartControlFactory"/>
                <ref object="ZedGraphChartFactory"/>
                <ref object="OpenMindedPlotFactory"/>

                <!--Commercial && Proprietary solutions-->
                <ref object="ChartFxFactory"/>
                <ref object="DevExpressFactory"/>
                <ref object="TelerikFactory"/>
                <ref object="TeeChartFactory"/>
                <ref object="ChartDirectorFactory"/>
                <ref object="ILNumericsFactory"/>
                <ref object="DotnetChartFactory"/>
            </list>
        </constructor-arg>
    </object>
    
    <!--Free && Open source solutions-->
    <object name="DisLinChartingFactory" type="FreeChartTools.FreeCharting.DisLinCharting.DislinChartFactory, FreeChartTools, Version=1.0.0.0, Culture=neutral" singleton="false" />
.............................................
    
    <!--Commercial && Proprietary solutions-->
    <object name="ChartFxFactory" type="ChartFXCharting.ChartFxFactory, ChartFXCharting, Version=1.0.0.0, Culture=neutral" singleton="false" />
..............................................

As I mentioned before all free assemblies included to solution. But since I can't do the same to commercial solutions, you may see next image on UI for some, that are not installed on your PC once you try to render it:

Image 18

If you wanna test commercial you must download them from appropriate link (i've provided links for each solution and showed them right on the UI).

You can test each solution on your PC, or compare performance for all charts. User interface is quite simple:

  1. You can run test for one selected solution (for example, you want to perform test-drive for some attracting solution right on fly, modifying existing code). Select solution and press 'Check'.
  2. You can configure each solution for your needs, and compare performance with parameters that you are interested in. Select amount of iterations for testing and press 'Compare all solutions'.

Image 19

If I missed some interesting chart solution, that can be used in .NET - just let me know, and I'll try to include it as soon as possible. Or, since this project also available at GitHub (https://github.com/perevernihata/DotNetChartingOverview), you can make these changes by yourself.

History

30.07.14 - introduced dotnetCharting solution to the article and sources.

04.08.14 - introduced Infragistics solution to the article and sources. All images hosted on CodeProject servers.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Software Developer (Senior) MYOB
New Zealand New Zealand
This member has not yet provided a Biography. Assume it's interesting and varied, and probably something to do with programming.

Comments and Discussions

 
Generalexcellent work Pin
Southmountain12-Jun-19 15:27
Southmountain12-Jun-19 15:27 
QuestionDevexpress Charts Pin
ScottBrady10-May-16 15:45
ScottBrady10-May-16 15:45 
Questiondifferences in results Pin
Buratino2k8-Oct-15 1:57
Buratino2k8-Oct-15 1:57 
QuestionTeeChart in 3D? Pin
Yeray Alonso19-Nov-14 4:07
Yeray Alonso19-Nov-14 4:07 
AnswerRe: TeeChart in 3D? Pin
Ivan Perevernykhata19-Nov-14 4:16
Ivan Perevernykhata19-Nov-14 4:16 
QuestionPerfect! Pin
sidedefence6-Nov-14 12:25
sidedefence6-Nov-14 12:25 
AnswerRe: Perfect! Pin
Ivan Perevernykhata6-Nov-14 20:39
Ivan Perevernykhata6-Nov-14 20:39 
GeneralMy vote of 5 Pin
Ștefan-Mihai MOGA13-Aug-14 3:24
professionalȘtefan-Mihai MOGA13-Aug-14 3:24 
GeneralRe: My vote of 5 Pin
Ivan Perevernykhata13-Aug-14 4:45
Ivan Perevernykhata13-Aug-14 4:45 
Suggestion[My vote of 2] Suggestions to make this article better Pin
mahendren6-Aug-14 3:01
mahendren6-Aug-14 3:01 
GeneralRe: [My vote of 2] Suggestions to make this article better Pin
Ivan Perevernykhata6-Aug-14 3:23
Ivan Perevernykhata6-Aug-14 3:23 
GeneralRe: [My vote of 2] Suggestions to make this article better Pin
mahendren6-Aug-14 21:18
mahendren6-Aug-14 21:18 
GeneralRe: [My vote of 2] Suggestions to make this article better Pin
Ivan Perevernykhata6-Aug-14 21:36
Ivan Perevernykhata6-Aug-14 21:36 
QuestionDon't forget Infragistics Pin
PSU Steve1-Aug-14 6:01
professionalPSU Steve1-Aug-14 6:01 
Infragistics makes a number of web charting controls too.

For ASP.NET: http://www.infragistics.com/products/aspnet/controls/chart[^]

For Silverlight: http://www.infragistics.com/products/silverlight/controls/data-chart[^]

for jQuery: http://www.igniteui.com/[^]

I personally haven't used the web charts, but have used the WinForms version of the charts a lot. They are awesome.
AnswerRe: Don't forget Infragistics Pin
Ivan Perevernykhata2-Aug-14 3:11
Ivan Perevernykhata2-Aug-14 3:11 
GeneralAmazing collection of chart controls Pin
bssrini30-Jul-14 12:58
bssrini30-Jul-14 12:58 
QuestionBest Charting Control Pin
vinodajacob30-Jul-14 8:14
vinodajacob30-Jul-14 8:14 
AnswerRe: Best Charting Control Pin
Ivan Perevernykhata30-Jul-14 9:46
Ivan Perevernykhata30-Jul-14 9:46 
Question.net Charting? Pin
jtmueller29-Jul-14 11:24
jtmueller29-Jul-14 11:24 
AnswerRe: .net Charting? Pin
Ivan Perevernykhata29-Jul-14 20:58
Ivan Perevernykhata29-Jul-14 20:58 
AnswerRe: .net Charting? Pin
Ivan Perevernykhata30-Jul-14 9:42
Ivan Perevernykhata30-Jul-14 9:42 
QuestionFree 3D Chart Pin
firmwaredsp28-Jul-14 4:49
firmwaredsp28-Jul-14 4:49 
GeneralMy vote of 3 Pin
ewebbi28-Jul-14 4:33
ewebbi28-Jul-14 4:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.