最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

Quick & easy PHPJavascript graphs - Stack Overflow

programmeradmin1浏览0评论

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

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

Share Improve this question asked Sep 24, 2009 at 10:59 AliAli 267k267 gold badges591 silver badges784 bronze badges
Add a comment  | 

8 Answers 8

Reset to default 7

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

  • GphpChart. I've used this one and it does a pretty reasonable job. You may need to modify it at times but that's fine;
  • Charts with PHP and Google Charts API;
  • googlechartseasyphpclass;
  • gchartphp (not maintained).

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

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

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.

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>

Dojo Charting provides a simple interface to create graphs.

I only discovered this yesterday, google Visualization API.

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

Results look pretty good.

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).

发布评论

评论列表(0)

  1. 暂无评论