views:

319

answers:

8

I'm looking for a simple and easy to integrate graph to display sales stats in a web application.

I will basically supply it the name of the month, and a numerical number of sales in that month. I'd like it to then chart out a graph showing the stats.

What's the best solution for this? I would prefer something attractive but still easy to integrate

+2  A: 

You can use the jQuery visualise plugin, it's a customizable and easy-to-use component, this does use the html element so you will have to check browser compatibility.

jQuery Visualize

Nicky De Maeyer
A: 

The best and the easiest solution would be to use amCharts (http://amcharts.com/) . It is a flash component (perhaps not what you are lookin for), but it would always be my choice.

vucetica
A: 

Dojo Charting provides a simple interface to create graphs.

Maine
+3  A: 

You can also use Flot to create charts, it's javascript based. http://code.google.com/p/flot/

Lex
A: 

If you don't need a very sophisticated graph you could draw a simple bar chart with some simple HTML. I've seen UI designers make this technique look really impressive.

The upside is that you don't need an additional library or worry about performance or page weight.

As a simple example of what I mean:

<html>
  <body>
    <div width="100%">
      <div style="float:left; width:70px">Jan</div>
      <div style="background: #0A0; width: 300px; margin-left:70px" >$300</div>
    </div>
    <div width="100%">
      <div style="float:left; width:70px">Feb</div>
      <div style="background: #A00; width: 122px; margin-left:70px" >$122</div>
    </div>
    <div width="100%">
      <div style="float:left; width:70px">Mar</div>
      <div style="background: #00A; width: 421px; margin-left:70px" >$421</div>
    </div>
    <div width="100%">
      <div style="float:left; width:70px">Apr</div>
      <div style="background: #0AA; width: 17px; margin-left:70px" >$17</div>
    </div>
  </body>
</html>
leonm
+4  A: 

Google Charts. There are a few PHP wrappers for this around:

cletus
A couple more to add to the list:http://pchart.sourceforge.net/http://teethgrinder.co.uk/open-flash-chart-2/
Phill Pafford
@Phill: those aren't for Google Charts. I've only listed Google Charts wrappers.
cletus
A: 

I only discovered this yesterday, google Visualization API.

http://code.google.com/apis/visualization/

Results look pretty good.

Cups
A: 

Highcharts is probably what you need.

I recently started a new project to simplify the construction of a graph when using php:

http://aloiroberto.wordpress.com/2010/02/04/highcharts-php-library/

Also, Google Charts or Open Flash Chart are concrete possibilities (the latter will require Flash).

Roberto Aloi