Create charts from SQL data in a web page

Posted on 2008-11-08
Last Modified: 2012-05-05
I have to create a website that displays SQL Server data in chart form.  Bar charts, line charts and some pie charts may be required.
The data is just tables of numbers like the winning lottery numbers by date.  
SQL queries will be doing sums, averages and such on the numbers to produce the data for the charts.
The Website is hosted on a "1and1" shared host with Microsoft SQL Server 2005 and ASP.Net 2.0 support.
Considering my experience level is "Beginner" in ASP.Net, VB, JavaScript, XML and SQL, how should I best approach this task?

I'm looking for the easiest way to get the data from the database into charts.

What chart technology would work best for this scenerio?

I've looked at amCharts, FusionCharts 2.0 (because it's free) and the Google Chart API.  I need someting easy to go from Query to chart.  Seems like XML is the way to go if the charts can read an XML file and I can get the queries to output to XML.

Thanks for suggestions, examples, experiences and code samples (especially SQL to XML examples)
Question by:megnin
    LVL 12

    Accepted Solution

    You should definitely go for ZedGraph library.
    Its a single dll you have to include in your project and can generate great looking
    graphs with little or no time.
    By little I mean is, using few lines of code, just passing your numbers in a array,
    and it will create graph for you.
    The best is that it has defaults for all kind of things, like for example, if you
    forget to give bar width, no worries, because a default is there which will take
    care for you.
    If I read it properly, its under LGPL license

    Here's the main page:

    Here's its code project article which explains it nicely with lots of ready source code
    available for download.

    Moreover, It works with windows forms as well as web forms (two different dlls I guess)
    You have to use the 'web forms' one.
    Also, it can create images of charts and cache them  or it can directly render to image tags as required.
    LVL 1

    Author Comment

    I just started looking at ZedGraph and was wondering if it might work.  Thank you for recommending it.  It looks very nice.  
    I think my next hurdle will be queries to get the calculations into those arrays.
    LVL 1

    Author Closing Comment

    Thank you for the suggestion.  If you have experience with ZedGraph I would really appreciate any code or query examples you could share.  I'm not very experienced and examples sure are helpful.
    Thank you again for recommending ZedGraph!
    LVL 12

    Expert Comment

    bind a DataTable to ZedGraphWeb to have it plot the datapoints

    a full example on zedgraph wiki

    (it uses rendermode :
    Imagetag which means an IMG tag is generated in place and image is generated and saved in specified folder)

    Hope it helped.
    LVL 1

    Author Comment

    Terrific!  Thank you.

    Featured Post

    Looking for New Ways to Advertise?

    Engage with tech pros in our community with native advertising, as a Vendor Expert, and more.

    Join & Write a Comment

    Hi, I am very much excited today since I'm going to share something very exciting Tool used for Analytical Reporting and that's nothing but MICROSTRATEGY. Actually there are lot of other tools available in the market for Reporting Such as Co…
    How to increase the row limit in Jasper Server.
    Using examples as well as descriptions, and references to Books Online, show the documentation available for date manipulation functions and by using a select few of these functions, show how date based data can be manipulated with these functions.
    This videos aims to give the viewer a basic demonstration of how a user can query current session information by using the SYS_CONTEXT function

    754 members asked questions and received personalized solutions in the past 7 days.

    Join the community of 500,000 technology professionals and ask your questions.

    Join & Ask a Question

    Need Help in Real-Time?

    Connect with top rated Experts

    18 Experts available now in Live!

    Get 1:1 Help Now