• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 1130
  • Last Modified:

Create charts from SQL data in a web page

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)
-David
0
megnin
Asked:
megnin
  • 3
  • 2
1 Solution
 
techExtremeCommented:
Hello,
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:
http://zedgraph.org/wiki/index.php?title=Main_Page

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

http://www.codeproject.com/KB/graphics/zedgraph.aspx



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.
0
 
megninAuthor Commented:
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.
0
 
megninAuthor Commented:
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!
0
 
techExtremeCommented:
bind a DataTable to ZedGraphWeb to have it plot the datapoints

http://zedgraph.org/wiki/index.php?title=How_do_I_bind_a_DataTable_to_ZedGraphWeb_to_have_it_plot_the_datapoints%3F

a full example on zedgraph wiki

http://zedgraph.org/wiki/index.php?title=Use_RenderMode.ImageTag_in_a_web_page

(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.
0
 
megninAuthor Commented:
Terrific!  Thank you.
0

Featured Post

Keep up with what's happening at Experts Exchange!

Sign up to receive Decoded, a new monthly digest with product updates, feature release info, continuing education opportunities, and more.

  • 3
  • 2
Tackle projects and never again get stuck behind a technical roadblock.
Join Now