SitePoint Sponsor

User Tag List

Page 1 of 2 12 LastLast
Results 1 to 25 of 27
  1. #1
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)

    Creating Graphs & Charts

    Is there any easy ways to use PHP to create Graphs and Charts?

    Or are there any open-source solutions out there which have done the heavy-lifting and provide a platform where you can build your own Graphs & Charts?

    It wouldn't be that hard to take a <div> and adjust its height and width based on values in your database, but I would think it would be murder to try and create your own axes, scales, labels, legends, etc from scratch?!

    BTW, I am not interested in anything which is Proprietary or uses JavaScript.

    My needs are fairly simple. I just want to create basic things like Bar Charts, Histograms, Pie Charts and so on.

    Thanks,


    Debbie

  2. #2
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    BTW, I am not interested in anything which is Proprietary or uses JavaScript.
    Why do you limit your options so much when asking questions?

    There's a good reason that Javascript has become the most popular way to create charts. If you change your mind then you should look at these:
    http://www.highcharts.com/
    http://d3js.org/

  3. #3
    PHP Guru lampcms.com's Avatar
    Join Date
    Jan 2009
    Posts
    921
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    My project: Open source Q&A
    (similar to StackOverflow)
    powered by php+MongoDB
    Source on github, collaborators welcome!

  4. #4
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    Why do you limit your options so much when asking questions?

    There's a good reason that Javascript has become the most popular way to create charts. If you change your mind then you should look at these:
    http://www.highcharts.com/
    http://d3js.org/
    1.) Because I associate JavaScipt with poorly planned and architected websites. It is a child's toy in most instances.

    The more JS a site has, usually the more obnoxious it is....


    2.) Because I despise Corporate America, and selling my soul to companies peddling proprietary software isn't my scene.

    Almost everything I use is open-source or home-grown.

    And my entire website is JavaScript-free and looks and runs as good as any that I have seen using it.


    I might be more flexible on charting solutions, since that is an area which wouldn't be an effective use of my time "rolling my own". And yet at the same time, it is my experience that there are often solutions that meet my constraints and still deliver.

    It is easy to follow the masses.

    I choose something more noble in life...


    Debbie

  5. #5
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    1.) Because I associate JavaScipt with poorly planned and architected websites. It is a child's toy in most instances.

    The more JS a site has, usually the more obnoxious it is....


    2.) Because I despise Corporate America, and selling my soul to companies peddling proprietary software isn't my scene.

    Almost everything I use is open-source or home-grown.

    And my entire website is JavaScript-free and looks and runs as good as any that I have seen using it.


    I might be more flexible on charting solutions, since that is an area which wouldn't be an effective use of my time "rolling my own". And yet at the same time, it is my experience that there are often solutions that meet my constraints and still deliver.

    It is easy to follow the masses.

    I choose something more noble in life...


    Debbie
    Oh my, well you seem very opinionated and I'm unlikely to change your mind.

    But for anyone else stumbling across this thread, Javascript is obviously no toy and is the the biggest language on GitHub. Anyone web developer refusing to use Javascript is going to be left behind.

    Dee, you should always be open to the fact that you could be wrong about these things, it's the only way to learn.

  6. #6
    SitePoint Wizard Lats's Avatar
    Join Date
    Jun 2003
    Location
    Melbourne, AU
    Posts
    1,142
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)
    Check this for a popular choice...

    http://jpgraph.net/
    Lats...

  7. #7
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    Oh my, well you seem very opinionated and I'm unlikely to change your mind.

    But for anyone else stumbling across this thread, Javascript is obviously no toy and is the the biggest language on GitHub. Anyone web developer refusing to use Javascript is going to be left behind.

    Dee, you should always be open to the fact that you could be wrong about these things, it's the only way to learn.
    Having an opinion that is different than yours doesn't make me wrong.

    And I should be commended for taking the path any new web developer should, that being...

    Learn solid HTML and CSS and markup semantics skills FIRST, and then after you have a solid footing - if you so choose - branch off into other things like JavaScript, Flash, etc.

    You can't build a viable web page or website without the former...

    Obviously I won't change *your* mind on this topic, but I stand by my decisions.

    My website is better because I am focusing on good design and features and functionality, and not on JavaScript "flash".

    And, btw, because I don't want or need interactive graphs or charts, there is no reason why I have to use JavaScript.

    Based on my limited research, it seems like there are some good choices out there which simply use PHP. (If I needed something where you could "slice and dice" data like a spreadsheet on real-time, then JavaScript might be more of a "must have".)

    Sincerely,


    Debbie

  8. #8
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Here are some promising sites I found last night...

    jpgraph

    pchart

    ezcomponents



    Debbie

  9. #9
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    Having an opinion that is different than yours doesn't make me wrong.
    And I should be commended for taking the path any new web developer should, that being...
    Learn solid HTML and CSS and markup semantics skills FIRST, and then after you have a solid footing - if you so choose - branch off into other things like JavaScript, Flash, etc.
    You can't build a viable web page or website without the former...
    I never said you were wrong because I disagreed, you were wrong to call Javascript a toy, that it was the result of poor planning and that it made sites obnoxious..
    Yes, you should learn HTML, CSS and Javascript in that order - but you should learn all three! they all have their part to play.
    Quote Originally Posted by DoubleDee View Post
    Obviously I won't change *your* mind on this topic, but I stand by my decisions.
    My website is better because I am focusing on good design and features and functionality, and not on JavaScript "flash".
    And, btw, because I don't want or need interactive graphs or charts, there is no reason why I have to use JavaScript.
    But there's no reason to have charts at all! Surely a table would suffice?
    The point is, charts are a better way to present data a lot of the time.
    A lot of time Javascript is a great choice too, your website isn't better without it, javascript can improve what's there.

    I'm not going to commend you for entirely dismissing an integral web technology while you tout it as something noble.
    Quote Originally Posted by DoubleDee View Post
    Based on my limited research, it seems like there are some good choices out there which simply use PHP. (If I needed something where you could "slice and dice" data like a spreadsheet on real-time, then JavaScript might be more of a "must have".)
    I've found server-side charting libraries don't give you the same level of control over the output as client-side ones do.
    There's the obvious benefits of being able to render dynamic content and respond to user interaction, you might not "require" it but it can add a lot to the user experience. The reason you are providing charts at all over a table is because of user experience.
    It's also good wherever possible to take processing off the server.

  10. #10
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    989
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    Here are some promising sites I found last night...

    jpgraph

    pchart

    ezcomponents



    Debbie
    I've used pChart. I had to fix a couple of minor text positioning bugs (that were likely down to the fonts I was using) when I used it but it works very well. The code is a bit of a mess, but the charts it creates are very nice indeed!

  11. #11
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    I never said you were wrong because I disagreed, you were wrong to call Javascript a toy, that it was the result of poor planning and that it made sites obnoxious..
    Yes, you should learn HTML, CSS and Javascript in that order - but you should learn all three! they all have their part to play.

    But there's no reason to have charts at all! Surely a table would suffice?
    The point is, charts are a better way to present data a lot of the time.
    A lot of time Javascript is a great choice too, your website isn't better without it, javascript can improve what's there.

    I'm not going to commend you for entirely dismissing an integral web technology while you tout it as something noble.

    I've found server-side charting libraries don't give you the same level of control over the output as client-side ones do.
    There's the obvious benefits of being able to render dynamic content and respond to user interaction, you might not "require" it but it can add a lot to the user experience. The reason you are providing charts at all over a table is because of user experience.
    It's also good wherever possible to take processing off the server.
    The key things to understand about how I feel about JavaScript is that I am tired of...

    1.) People changing the sequence FROM

    Proper Design ---> Thinking about Semantics ---> HTML --> CSS ---> (maybe) JavaScript

    INTO JavaScript! JavaScript! JavaScript! (and maybe some of that other stuff if there is time)


    2.) People's inability to think and plan and solve problems without JavaScript. (For example, I have built a respectable Private Message system that looks almost identical to Yahoo E-mail entirely using PHP. No JavaScript.)


    3.) People focusing on superficial Bells & Whistles (e.g. JavaScript) instead of CONTENT


    4.) People only see the world one way. (There was life before JavaScript and there is life after it.)

    JavaScript is one tool. It is not some panacea.


    Will I someday learn and use JavaScript?

    Yes. After I am running a successful website and business, and I attempt to add that remaining 5-10% to my User's experience. Never forgetting... Horse then Cart...


    Debbie

  12. #12
    SitePoint Wizard DoubleDee's Avatar
    Join Date
    Aug 2010
    Location
    Arizona
    Posts
    3,764
    Mentioned
    2 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by TomB View Post
    I've used pChart. I had to fix a couple of minor text positioning bugs (that were likely down to the fonts I was using) when I used it but it works very well. The code is a bit of a mess, but the charts it creates are very nice indeed!
    How is the documentation?

    What would I have to learn to start using it?

    Do I need to know OOP or any special languages?

    If I am going to break down and use someone else's code-base, then I want something easy and intuitive, otherwise I might as well build my own?!


    Debbie

  13. #13
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    1.) Because I associate JavaScipt with poorly planned and architected websites. It is a child's toy in most instances.

    The more JS a site has, usually the more obnoxious it is....


    2.) Because I despise Corporate America, and selling my soul to companies peddling proprietary software isn't my scene.

    Almost everything I use is open-source or home-grown.

    And my entire website is JavaScript-free and looks and runs as good as any that I have seen using it.


    I might be more flexible on charting solutions, since that is an area which wouldn't be an effective use of my time "rolling my own". And yet at the same time, it is my experience that there are often solutions that meet my constraints and still deliver.

    It is easy to follow the masses.

    I choose something more noble in life...


    Debbie
    Oh, Javascript is a "child's toy"?

    Try telling that to Google.

    Javascript is a serious language that also has the best solutions to your problem.

    Highcharts library is the best graphing library for the web that I'm aware of, and the amount of money they ask for their license is peanuts compared to the profits you can make by using it, and the amount of man-hours and skill that have been put into it.

    Just because you don't personally know how to use javascript properly does not mean that javascript is a "child's toy in most instances". Unfortunately, it's a child's toy to you because you don't know what you're talking about :-)

    Good luck finding a crappy solution to your problem.

  14. #14
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    How is the documentation?

    What would I have to learn to start using it?

    Do I need to know OOP or any special languages?

    If I am going to break down and use someone else's code-base, then I want something easy and intuitive, otherwise I might as well build my own?!


    Debbie
    What's wrong with having to know OOP?

  15. #15
    SitePoint Guru bronze trophy TomB's Avatar
    Join Date
    Oct 2005
    Location
    Milton Keynes, UK
    Posts
    989
    Mentioned
    9 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    How is the documentation?

    What would I have to learn to start using it?

    Do I need to know OOP or any special languages?

    If I am going to break down and use someone else's code-base, then I want something easy and intuitive, otherwise I might as well build my own?!


    Debbie
    The documentation is very good. There's an example script for pretty much any kind of chart you can think of. It's quite easy to get the hang of and all the data is fed into the charts using simple arrays-- easy to generate from queries and such.

    It does use OOP but doesn't really follow a lot of the principles, it's really lacking on a sensible separation of concerns. It's procedural code in objects really. It's a bit messy, and from an idealogical point of view the code isn't very nice in places. That said, you won't need to touch the code much. If at all.

    It is quite a large library, building a flexible charting library from scratch is a big job. If you're just building a one off chart of a specific type then it may be worth while. But pChart and such give the ability to quickly switch between a pie chart/bar chart etc with a single line of code.

    On one hand, I can't compare it to any of the other libraries. On the other I can safely say I never felt the need to look for another one because pChart suited my needs perfectly.

  16. #16
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by aaarrrggh View Post
    Highcharts library is the best graphing library for the web that I'm aware of, and the amount of money they ask for their license is peanuts compared to the profits you can make by using it, and the amount of man-hours and skill that have been put into it.
    I agree with this, I'm yet to dig into d3 but it seems to be gaining a lot popularity. The examples speak for themselves, it's quite powerful.
    Quote Originally Posted by aaarrrggh View Post
    Good luck finding a crappy solution to your problem.
    Not necessary

  17. #17
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by markbrown4 View Post
    I agree with this, I'm yet to dig into d3 but it seems to be gaining a lot popularity. The examples speak for themselves, it's quite powerful.

    Not necessary
    The reason I responded to her like that is because she seems to me to have some of the worst personality traits you could expect from a [snip] developer: she's [snip] overly confident to the point of sheer arrogance. I had a look at some of her other posts, and she was doing things like mocking people for using GIT (because she thought GIT = your code is available for everyone in the world to see), and complains that the tech department in her work are not up to her "standards". She mocks Javascript as some superfluous "toy", yet clearly doesn't understand what Javascript actually is and how powerful it really is.

    I don't mind people who are learning and have a positive attitude, but I can't stand [it when people go] around mocking [other] people.

    That's all ;-)
    Last edited by HAWK; Aug 2, 2012 at 16:48. Reason: Edited to remove the personal insults but retain the message

  18. #18
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    I would suggest you give jpGraph a try. I've used it for many large graphing projects. You can use it to make about any graph type you can think of -- Line, Bar, pie, scatter, Impluse, Field, Splines, Geo Maps, Stock, Polar, Error, Balloon, Radar, Contour, and if you purchase the pro version you can also make barcodes among other graphs.

    You can skin/theme each graph however you want. You have limitless control over the look and feel.

    The documentation is extremely good. There are examples for every graph type, and more examples for graph variations/graph options. The API reference is very good, and the how-to reference does a good job at walking you through creating (and customizing) the different graphs step-by-step.

    I've never encountered any real bugs in it either. I've never had to go edit the source code. It's a big library, but it's broken up into components so you can include only the functionality you need/want.

  19. #19
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by aaarrrggh View Post
    she was doing things like mocking people for using GIT (because she thought GIT = your code is available for everyone in the world to see)
    It's actually an easy mistake to make, git is best known for github and github is best known for open-source.

    But, yes, we all have plenty to learn.
    So we need to remain open and not be set in our ways.

  20. #20
    SitePoint Addict kduv's Avatar
    Join Date
    May 2012
    Location
    Maui, HI
    Posts
    211
    Mentioned
    5 Post(s)
    Tagged
    0 Thread(s)
    You cannot give someone more tea if their teacup is already full.

  21. #21
    padawan silver trophybronze trophy markbrown4's Avatar
    Join Date
    Jul 2006
    Location
    Victoria, Australia
    Posts
    4,108
    Mentioned
    28 Post(s)
    Tagged
    2 Thread(s)
    Quote Originally Posted by kduv View Post
    You cannot give someone more tea if their teacup is already full.

  22. #22
    Non-Member
    Join Date
    Oct 2007
    Posts
    363
    Mentioned
    11 Post(s)
    Tagged
    0 Thread(s)
    I don't mind the fact that she didn't know what GIT was.

    What bothered me was how arrogant she was to the guy suggesting she use it, and her arrogance was based on her ignorance of GIT.

    Ignorant people who think they know it all and who respond with arrogance and derision to people who know what they are talking about really bother me.

    It's just her attitude I take issue with. If she doesn't know how something works or what something does, that's cool, and I'll help out where I can (I learn new stuff from people all the time - I just don't pretend to know it all), but if she's gonna effectively say that people who use Javascript are amateurs who are using 'toys' when "professionals" like her are creating 'content', then I'm gonna call her up on her crap.

  23. #23
    Galactic Overlord gold trophysilver trophybronze trophy
    HAWK's Avatar
    Join Date
    Aug 2003
    Location
    New Zealand
    Posts
    12,540
    Mentioned
    956 Post(s)
    Tagged
    14 Thread(s)
    I've edited your post no#17 slightly @aaarrrggh ; because while I agree with your sentiment and have no issue with your message, it's not cool to make personal insults around here, and your post did cross that line.

    Let's get back on topic now before this turns into an argument that has to be shut down.

  24. #24
    Community Advisor ULTiMATE's Avatar
    Join Date
    Aug 2003
    Location
    Bristol, United Kingdom
    Posts
    2,160
    Mentioned
    46 Post(s)
    Tagged
    0 Thread(s)
    Quote Originally Posted by DoubleDee View Post
    1.) Because I associate JavaScipt with poorly planned and architected websites. It is a child's toy in most instances.

    The more JS a site has, usually the more obnoxious it is....
    Usually, I would agree with you. One of my current favourite sites is the D programming language forum because there is little to no JavaScript and the pages load as fast as they would if it were a native application. Modern developers are too quick to run to the loving arms of jQuery to do everything and I despise the overuse of JavaScript and the horrific page sizes of some sites.

    However, calling JS a child's toy without anything to back it up with is insane. Sure, it's a pretty poor language that has made some shocking design decisions, but it's the best we've got to add any kind of dynamic client-side functionality to a web page. Browser vendors have done some fantastic work in increasing the speed and power of their JavaScript engines and the power you can be afforded with some JS is quite remarkable.

    Quote Originally Posted by DoubleDee View Post
    I might be more flexible on charting solutions, since that is an area which wouldn't be an effective use of my time "rolling my own". And yet at the same time, it is my experience that there are often solutions that meet my constraints and still deliver.
    Well, if you're not going to use a "charting solution" then you're either rolling your own charting script or using an image. There really isn't any other way around it.

    Either way, I've used Highcharts for some high-end clients and if you've got the patience to read through the documentation and test your JS using jsFiddle then there's nothing better. I'm afraid it's the best you're going to find.

  25. #25
    ♪♪ ♪ ♪ ♪ ♪♪ ♪ ♪♪ Markdidj's Avatar
    Join Date
    Sep 2002
    Location
    Bournemouth, South UK
    Posts
    1,551
    Mentioned
    1 Post(s)
    Tagged
    0 Thread(s)
    Hi DoubleDee. If you want to create charts and graphs look in to writing dynamic CSS sheets in PHP.
    Simple bar graphs are easy, you just change the size of the divs. Pie charts are a little more complicated but there are a lot of new commands you can use, like rotation and skew.

    When it's done, you could enhance it with a timed javascript style switcher which would make them live.
    LiveScript: Putting the "Live" Back into JavaScript
    if live output_as_javascript else output_as_html end if


Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •