开发者

how to create chart to display database values? [closed]

As it currently stands, this question is not a good fit for our Q&A format. We expect answers to be supported by facts, references, or expertise, but this question will likely solicit debate, arguments, polling, or extended discussion. If you feel that this question can be improved and possibly reopened, visit the help center for guidance. Closed 10 years ago.

hi all i want to display database values开发者_如何学Go in chart. for example a table contain four column and each column have different number of documents. I would like to display that table in chart format.. can i do it? if so any one suggest how to do it...

thank u all....


Only thing you need is database itself!

+----------------------------------------------------------------------+
| pie_chart                                                            |
+----------------------------------------------------------------------+
|                                                                      |
|                         ;;;;;;;;;;;;;;;;;;;;;                        |
|                  oooooooo;;;;;;;;;;;;;;;;;;;;;;;;;;;                 |
|             oooooooooooooo;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;            |
|          ooooooooooooooooo                 ;;;;;;;;;;;;#####         |
|        oooooooooooooo                           ;#############       |
|       oooooooooooo                                 ############      |
|      oooooooooooo                                   ############     |
|      ooooooooooo                                     ###########     |
|      oooooooooooo                                   ::::::::::::     |
|       oooooooooooo                                 ::::::::::::      |
|        ooooooooo:::::                           ::::::::::::::       |
|          o::::::::::::::::                 :::::::::::::::::         |
|             :::::::::::::::::::::::::::::::::::::::::::::            |
|                  :::::::::::::::::::::::::::::::::::                 |
|                         :::::::::::::::::::::                        |
|                                                                      |
| ##  red: 1 (10%)                                                     |
| ;;  blue: 2 (20%)                                                    |
| oo  orange: 3 (30%)                                                  |
| ::  white: 4 (40%)                                                   |
+----------------------------------------------------------------------+

Really cool approach from http://code.openark.org/blog/mysql/sql-pie-chart
:-)


If working in JavaScript, take a look at Google Charts - http://code.google.com/apis/chart/


Since you added the javascript tag, have a look here: http://www.jqplot.com/

In my opinion the easiest way to make nice looking charts.


You could try using Google's Chart API - http://code.google.com/apis/chart/

EDIT

There's a few you could use:

  • http://code.google.com/p/flot/ - uses jQuery
  • http://dojotoolkit.org/grids-charts - uses Dojo
  • http://www.highcharts.com/ - pure JavaScript

EDIT 2

There's also flash alternatives if you wanted to go down that road:

http://www.fusioncharts.com/free/ - free limited version of commercial product http://www.amcharts.com/download - free watermarked version


Are you looking for the JS charting API ? check http://www.splashnology.com/blog/javascripts/290.html


We use this one - PHP/SWF Charts 4.7


Since you tagged PHP and JavaScript, you can do it with either of those. You can use PHP and its GD library (should be standard on many installations) or you can use JavaScript with it's 2D canvas support. Later is not supported in all browsers yet.

Long time ago I wrote this little PHP script which generates PNG image like this:

how to create chart to display database values? [closed]

This probably isn't the chart you want but I hope code will help you at least a little bit.

Edit: You can use this if you don't want to use 3rd party libraries. Otherwise I'd really suggest to go for one of well know libraries suggested by other people.

0

上一篇:

下一篇:

精彩评论

暂无评论...
验证码 换一张
取 消

最新问答

问答排行榜