Slashdot Mirror


Custom Charts w/ Perl and GD

An anonymous reader writes "This article describes techniques you can use to create new levels of usefulness in your dynamically generated charts with Perl and GD. Cook up some automatically generated graphs for your organizational meetings or live enterprise directory data. Annotate the charts with readable text that delivers more information than the standard pie chart. Using the power of GD and Perl, you can link various data and images together to create sophisticated charts that will help bring visual interest to your applications."

112 comments

  1. Don't get it.. by RightSaidFred99 · · Score: 0, Troll
    Aren't there approximately 27,352 artcles on this subject out there? What makes this one news or interesting in any way?

    "Our next exciting story - a new article from BlahBlah.com with details on how to add active javascript links to your HTML!". zzzzzzz.

    1. Re:Don't get it.. by DustyShadow · · Score: 0, Troll

      Aren't there approximately 27,352 comments like yours for every Slashdot article? What makes yours news or interesting in any way?

    2. Re:Don't get it.. by Hijacked+Public · · Score: 4, Funny

      I don't know man, they have a donut chart on there with some pretty serious graphics laid into it. That beats most other articles with their plain Jane donut charts, these ones have upper management written all over them.

      Maybe they should email a link to Edward Tufte...amybe he'll be insterested. Data graphic geniuses these folks.

      --
      "Sacrifice for the good of The State" - The State
    3. Re:Don't get it.. by caramelcarrot · · Score: 1

      Plus, if you actually want decent open-source charts for documents, use gnuplot, they've done the hard work for you. Or any one of loads of plotting libraries for perl/php/whatever.

    4. Re:Don't get it.. by Bodero · · Score: 2, Interesting

      Agreed. I had the same problem not too long ago about making dynamic charts that look professional.

      My solution was to use Perl and Win32::OLE to interface with Excel 2003 using VBA scripting within Perl. Sure, it's a Windows-only solution, and it's not open source, but it was an intranet problem that needed to be solved.

    5. Re:Don't get it.. by Riverman5 · · Score: 1, Offtopic

      I think the business interests involved in this want to see to it that you're modded down.

      Yeah this GD/Perl stuff is old news, I use flash for charts, fusion charts.

    6. Re:Don't get it.. by carlivar · · Score: 1

      With rather strict standards for article/submission acceptance on slashdot, I tend to agree with the original poster. Which article does not look like the others? This one.

      --
      Vote Libertarian
    7. Re:Don't get it.. by vk2 · · Score: 2, Interesting

      Have you seen this? http://www.advsofteng.com/

      --
      No Sig for you.!
    8. Re:Don't get it.. by Ross+D+Anderson · · Score: 1

      Yeah!
      This one isn't a dupe, isn't cussing microsoft, doesn't mention open source and has no reference to apple!
      I'm dissapointed. Those standards are slipping boys!

    9. Re:Don't get it.. by carlivar · · Score: 1

      You're right! I'm going to write and submit an article called "how to defragment your hard disk". That doesn't have anything to do with those subjects either.

      --
      Vote Libertarian
    10. Re:Don't get it.. by krishn_bhakt · · Score: 1

      http://www.gnuplot.info/faq/faq.html says: "Gnuplot is freeware in the sense that you don't have to pay for it. However it is not freeware in the sense that you would be allowed to distribute a modified version of your gnuplot freely. Please read and accept the Copyright file in your distribution." Further, http://www.gnuplot.info/faq/faq.html#SECTION000310 00000000000000 says: "gnuplot is copyrighted, but freely distributable; you don't have to pay for it." "gnuplot is not related to the GNU project or the FSF in any but the most peripheral sense. Our software was designed completely independently and the name "gnuplot" was actually a compromise."

      --
      The Answer Lies in The Genome
  2. These charts look like shit by Anonymous Coward · · Score: 2, Interesting

    When will open source advocates learn to delegate the graphic design aspect of their work to professionals? Plenty of designers would be more than happy to contribute, if only the programming types in charge of these projects would admit they're better at making code than graphics.

    1. Re:These charts look like shit by Solra+Bizna · · Score: 2, Funny

      I'm better at making code than graphics.

      Now, if only other people were better at waiting on my every graphical need, free of charge...

      -:sigma.SB

      --
      WARN
      THERE IS ANOTHER SYSTEM
    2. Re:These charts look like shit by dbcad7 · · Score: 3, Informative
      I think the examples are meant to show how it works, not to wow you with art.

      The code looks easy enough to experiment with your own artwork, so I look forward to seeing how much better you can do.

      --
      waiting for ad.doubleclick.net
    3. Re:These charts look like shit by dodobh · · Score: 4, Insightful

      The code is out there. Whenever the graphics folks want to start contributing, they can.

      --
      I can throw myself at the ground, and miss.
    4. Re:These charts look like shit by EsbenMoseHansen · · Score: 2

      KDE have a quite a few very good contributors who are of the more graphical persuation. I believe firefox have a few as well. But they are always in short supply even compared to coders, so if you know any, please direct them to the appropriate sites. (I'm sure it is the same with Gnome, but I agree with Linus on that one).

      --
      Religion is regarded by the common people as true, by the wise as false, and by rulers as useful.
    5. Re:These charts look like shit by Anonymous Coward · · Score: 0
      Whenever the graphics folks want to start contributing, they can.

      I've tried, but there isn't any software that'll convert my graphics to code. I mean, this is 2007, isn't there a something GL tool out there that'll program from my pictures?

      SO, it's really back in the coder's court now. So, get with it! Geese!

    6. Re:These charts look like shit by zeroduck · · Score: 1

      Theres always graphical programming languages, like LabVIEW. You can make your code a piece of art.

    7. Re:These charts look like shit by hxnwix · · Score: 1

      Hey, don't let us stop you.

    8. Re:These charts look like shit by Jeff+DeMaagd · · Score: 1

      The code is out there. Whenever the graphics folks want to start contributing, they can.

      I think this is indicative of a disconnect.

      There is an underlying assumption that even though the coders apparently can't do graphic design worth jack, that graphic designers can somehow code worth jack. Most graphic designers aren't coders, and most coders aren't graphic designers. The disciplines aren't mutually exclusive, but most in one field can't do much of value in the arts of the other field. Usually, it's better to have mutual cooperation than expect graphic designers to come in on their own.

    9. Re:These charts look like shit by grcumb · · Score: 3, Insightful

      There is an underlying assumption that even though the coders apparently can't do graphic design worth jack, that graphic designers can somehow code worth jack. Most graphic designers aren't coders, and most coders aren't graphic designers. The disciplines aren't mutually exclusive, but most in one field can't do much of value in the arts of the other field. Usually, it's better to have mutual cooperation than expect graphic designers to come in on their own.

      I agree with what you're saying, but I think you've got the onus wrong. As someone with design and coding experience, I can say that FOSS programmers often bend over backwards to package things nicely, but are often rebuffed by non-programmers if the interface is not 100% to their liking.

      There is a disconnect, but IME it comes from people who think that being a user entitles them to sit back and wait for manna to drop from heaven. The bottom line is simply this: If you're going to work in FOSS, then you have to get your hands dirty. This almost necessarily means learning a little about areas that are not your forte. In order for there to be reasonable cooperation, we need to speak the same language. In the Perl community especially, there is a real desire to learn new things and share knowledge, but if designers et alia aren't willing to learn at least a little Perl, then there's not much to be done.

      "Don't make me look at code" is, unfortunately, not often a valid condition for any FOSS participant, regardless of their other talents.

      --
      Crumb's Corollary: Never bring a knife to a bun fight.
    10. Re:These charts look like shit by MikeBabcock · · Score: 3, Insightful

      That's the stupidest comment that gets repeated about all sorts of things in Open Source. There are people who can document, who can theorize and who can draw much better than they can code. If coders and those who can't code but have potential for contribution would communicate, we'd end up with better software. Software isn't just code, sorry to say. Yes yes, "show me the code" is a great line, and wrong for almost everything outside libraries and kernel space (and even then, some documentation writers, theorists and idea people should be involved more than they are by the coders).

      --
      - Michael T. Babcock (Yes, I blog)
    11. Re:These charts look like shit by Have+Brain+Will+Rent · · Score: 1
      I have done a lot of software design and implementation and a lot of UI design and implementation but I tend to agree with the sentiment that programmers shouldn't be doing UI work - the results usually leave a lot to be desired and to see why you only have to read /. for a while to get a sample of the attitude that many programmers have toward users. I also have problems with the other side, as the parent says, waiting for manna to drop from heaven.


      But graphic artists can contribute without knowing anything about programming... they need only mock up screens (pencils, paper etc.) to show what could be done to improve an existing design. Whether that's the color scheme, the layout, the interaction sequences or what have you, they don't need to know anything about programming to help the programming crowd improve the end result. They don't need, as one poster put it, "GL" tools to make programs from their designs. They simply need to be able to create designs that other people can understand. If they aren't willing to do that they they should quit their bitching and if software people aren't willing to accept that those designs might be better, than whatever they came up with on their own, then then should try and figure out what it is they are hoping to accomplish.

      --
      The tyrant will always find a pretext for his tyranny - Aesop
    12. Re:These charts look like shit by dbIII · · Score: 1
      Sliding a bit off topic here but gimp is a prime example. It appears to be great stuff for people putting together web page graphics on a platform where you have multiple screens (not really sure - only ever did that on a small scale) but print graphics designers don't go past saying "it's not photoshop - come back when it's a slavish photoshop clone" so gimp gets what the developers think might be useful and have to play a guessing game. The "don't ask me for what features I need just give me photoshop" attitude does not work because the developers do not use other packages as much as a graphics designer so really do not know what features in photoshop they are using - just skimming the surface. They also may see a feature that can be better implemented without knowing that it is that way to work with other features. The older photoshop GUI (not sure about now) would be horrible on a multiple desktop situation like in X windows - even the old gimp 1.* GUI was a far better solution in my view for opening up a few dozen images at once to cut and paste stuff into all of them - that would be very hard to manage on a single desktop which is what photoshop is restricted to.

      People also hate change and defend even the worst features of the application they are used to - I accidently started off a pile of flames on a photoshop newsgroup long ago when I asked how to use "undo" in photoshop back when gimp had it and photoshop didn't (which I did not know, since I only had limited access to the thing on a shared work PC and no docs). I was informed by many that true professionals saved their work before every major operation so the feature was not needed (I think most of those flaming were not graphics professional either and just wanted to have a go at a noob) - obviously it got added in afterwards but that is an example of the attitude faced if you just ask someone at random. How do we make these people want to be involved and come in without a defensive attitude?

    13. Re:These charts look like shit by Anonymous Coward · · Score: 0

      Oh, right, there's a productive answer: if you're a graphic artist and want to contribute, all you have to do is learn Perl first.

    14. Re:These charts look like shit by myowntrueself · · Score: 1

      When will open source advocates learn to delegate the graphic design aspect of their work to professionals?

      My partner, a graphic designer, says the same thing about the artwork in the Dungeons and Dragons manuals... I guess geeks everywhere and in every age think they can draw or something...

      --
      In the free world the media isn't government run; the government is media run.
    15. Re:These charts look like shit by lpq · · Score: 1

      There is a disconnect, but IME it comes from people who think that being a user entitles them to sit back and wait for manna to drop from heaven. The bottom line is simply this: If you're going to "work" in FOSS, then you have to get your hands dirty.


      If there is any question in people's mind about whether or not Linux or FOSS software is is ready for the average user's desktop, maybe it can be answered here. Users can't expect to just get software and have it work. Before they can do their work (or play, whatever), they first have to get their hands dirty and learn programming. Yeah -- that makes FOSS just so appealing. One needs to be a developer and willing to run beta's on every software product they want to use. They can't just "sit back" and expect it to work (these days, programs that "just work" are a bit like "manna from heaven" and about as common). It's like requiring users to be car mechanics in order to drive an FOSS car. And if a user should want to ask for an automatic transmission like they have on cars from MS or Apple? They are often told to become a transmission expert themselves and to write the code.

      If a car manufacturer required all drivers of its cars to be auto mechanics and car system experts vs. simply providing a working car and allowing the driver to be an expert in something else, I suspect the car with the lower "cost of ownership" (especially in terms of "invested knowledge") will appear considerably more attractive.

      I don't think it is unrealistic to want to use an auto as a tool to get other things done. Requiring every user to be a "developer" is one of the biggest problems of FOSS. It makes cost of ownership too high. It only seems suitable for those willing to have "no life" outside of maintaining their car (or computer programs). Might partially explain the fanaticism surrounding Open Source.

      Next thing, you'll be expecting "managers" to have to "code" to use FOSS programs. Unfortunately, many companies look down upon managers who waste their time doing "development" instead of managing and getting others to do it. Same applies to higher level engineers. They are expected to spend most of their time doing design -- it's inefficient and poor resource usage to expect them to work with inadequate tools (or tools that need development time invested in them before they will work).

      That so many in FOSS can't see the inefficiency of requiring all users, to be some level of developer, on every tool they use, makes me doubt that such FOSS developers (and their projects/software) will ever do well in a business environment or home-desktop environment.

    16. Re:These charts look like shit by dodobh · · Score: 1

      The designers sure can offer suggestions and help. You don't have to write code to contribute (but it sure helps).

      --
      I can throw myself at the ground, and miss.
    17. Re:These charts look like shit by chromatic · · Score: 1

      That so many in FOSS can't see the inefficiency of requiring all users, to be some level of developer, on every tool they use...

      Besides you, who said anything about requiring any users to become developers? Contributors, yes. Developers, no.

    18. Re:These charts look like shit by dodobh · · Score: 1

      Or you know, actually SHOW fixed versions of whatever they think is wrong, with explanations of why.

      Someone at a conference (Aaron Siego, KDE dev, IIRC) explained this little tidbit about usability:
      The usability people who volunteered to try and help the KDE developers were speaking their own language, not one the programmers understood. Once that little hurdle was found, both sides got together and figured out common ground. The thing is that you have to learn to communicate with the programmers in the FOSS world, not they with you (they try, but without some effort from the other side, communication isn't going to be feasible).

      --
      I can throw myself at the ground, and miss.
    19. Re:These charts look like shit by avronius · · Score: 1

      I don't believe that you should have been flamed - Photoshop has had undo since at least 1991 [this is when I started using 2.0]. Not sure if was there an undo prior to that, but I doubt that you would have been discussing the GIMP back then ;)

      In all fairness, there wasn't a multiple level undo until much later [version 5 or so], so you would have needed to save prior to doing multiple changes.

    20. Re:These charts look like shit by avronius · · Score: 1

      It's like requiring users to be car mechanics in order to drive an FOSS car. I would think that it's more like belonging to a focus group discussing a concept car. The developers need [useful] feedback.

      Saying, "I hate it. What is it?" won't help. Saying, "I don't like having to go seven layers into a menu to do this common procedure" will help.

      That so many in FOSS can't see the inefficiency of requiring all users, to be some level of developer, on every tool they use Have you ever made a recommendation for process improvement? Have you ever contributed to a project that required your special skills or unique insight? Have you been passed up for a promotion based on your recommendations or insight on a project?

      FOSS is not for everyone.
      Many people are willing to invest cash for a product that "just works" and requires no investment of time to aid in development.
      Many people are willing to invest time for a product that requires no financial outlay to compensate for development.
    21. Re:These charts look like shit by lpq · · Score: 1

      FOSS is not for everyone.
      Many people are willing to invest cash for a product that "just works" and requires no investment of time to aid in development.
      Many people are willing to invest time for a product that requires no financial outlay to compensate for development.


      This is, basically, my point. When will "Linux" or "FOSS" (the terms are both vaguely defined) be ready for the corporate or home desktop? At that point, you are mostly talking _users_ of computers that know little or nothing about computers. They won't be able to give intelligent feedback. They won't know what a "README" is, or a [core/mem]dump, or any of a 1000 other terms you and I take as "ABC's".

      As long as the public face of FOSS development clamors for attention of the user's. Then the desktop will be a non-starter.

      Until the FOSS-projects are at the stage of being "compilers" (When was the last time you contributed to "gcc"?), they won't be ready for "prime-time", the desktop, or most "end-users".

      Maybe I'm, blind, but the GNU compiler project[s] seem to be perfect examples of stuff that, for the most part, just works. I don't have to become a compiler "contributor" just to use it. How many projects use compilers that contribute anything to the Gnu Compiler project? I bet the percentage is _near_ zero.

      Do you see a difference? When was the last time a compiler person suggested that you contribute? How many people should we expect to develop the expert knowledge of how the compiler works in order to be able to contribute "intelligently" (as often required for submissions). Heck -- how many times do I see FOSS developers make disparaging remarks when people just try to submit a problem: "Oh, you have to fill in form X31-B, include coredumps in triplicate, and run our information-farming tool on your system or we won't even look at your problem".

            "Uh...yeah...thanks, it was a spelling error in a menu I was reporting..."

            Now days, it seems many FOSS developers feel they are owed something that was originally described as "contributing" to the community. Seems like many FOSS developers are feeling they are "owed" something -- which means their work _isn't_ contributed, it's done with strings attached. Perhaps I'm naive, but it seems holding an attitude that user's of my software "owe" me something is a problem with FOSS. What some FOSS developers seem to think is owed them has a higher cost of ownership than buying the equivalent, not-so-well-done "bigCorp" product. Yuck.

    22. Re:These charts look like shit by ACORN_USER · · Score: 1

      These are development tools and like it or not, developers are often asked to write visual applications, where the emphasis is on content and not beauty. I've used both perl and GD in the financial sector to plot curves, where people only wanted a visualisation of data and not a graphically designed splash of paint. I give a thumbs up to libgd.

  3. wow! by jdunn14 · · Score: 2, Funny

    With a general purpose language tied to a drawing library I can make custom graphics? Holy crap, who would have thought. For those of us who just want to generate some simple graphs for papers and such, what do people use? I've messed with Excel, gnuplot, R, and now I'm using ploticus. Anyone have better solutions?

    1. Re:wow! by Anonymous Coward · · Score: 0

      Why perl and gd, of course! How come you didn't think of that, you wonder?

      Time to whip out that live enterprise directory data and start hacking!

    2. Re:wow! by Coryoth · · Score: 5, Informative

      For those of us who just want to generate some simple graphs for papers and such, what do people use? I've messed with Excel, gnuplot, R, and now I'm using ploticus. Anyone have better solutions? To be honest I would suggest you try messing with Gnuplot some more -- it is actually a lot better, and produces much nicer plots, than it seems at first. The trick is to use a different terminal type than "x11", which is pretty crappy; the output looks remarkably different if you use "png", "svg" or "postscript". Here are some examples of plots I've done with Gnuplot: [1], [2], [3] [4] (for the last link, note that vertical text alignment renders fine in inkscape, just not on Wikipedia -- download the svg file to see).

      If that's still not tickling your fancy then I would suggest matplotlib which is actually pretty versatile, and produces good looking plots. There's also PyX if you're looking for slightly more raw graphical interaction with nice output. Truth be told, however, after messing around with many of the same options you have, I've found that Gnuplot, once you get over the initial learning hurdle and figure out how to turn out nice looking plots, is the fastest and easiest way to turn out plots and charts.
    3. Re:wow! by ytm · · Score: 1

      I have to use Excel at work for presentation because we need dynamic charts based on pivot tables. For inspiration I recommend these pages. Most of these methods show ways around Excel limitations and twisted paths to display your data right.

      For paper presentation I'd go with gnuplot. It requires some work to get it right, but results are impressive and can be easily embedded in LaTeX environment.

      As for TFA, I would think that with a programming language and graphics library we would be able to see some more information on a chart. Like the bottom one.

    4. Re:wow! by Anonymous Coward · · Score: 0

      I second this. gnuplot is a wonderful tool for plotting, and even for basic data transformation; you just need to spend some time setting various options to make it look like you want (my gnuplot scripts are typically ~25 lines/commands per plot). I use it for all my plots at work. Example: I generally prefer simple plots with lots of whitespace, and gnuplot does this better than any other plotting software I've found.

      - nickersonm

    5. Re:wow! by choongiri · · Score: 2, Interesting

      > Anyone have better solutions?

      Yes.

      eZComponents Graph, from the developers of the eZpublish CMS. It's FLOSS, easy to use, and works very well for some automatically generated graphs I made that needed to update every week.

    6. Re:wow! by Anonymous Coward · · Score: 0

      For those of us who just want to generate some simple graphs for papers and such, what do people use?

      Personally, I just code the plot directly in PostScript. Typically I structure the file so there's a header controlling the look of the plot, the data plotting routine itself in the middle and then the raw data is appended to the end of the file.

      The advantage is that the plot and the data are in the same place (the same file even). The disadvantage is that you have to learn PostScript.

    7. Re:wow! by atrus · · Score: 1

      I agree, GNUPlot is quite capable.

    8. Re:wow! by Andy+Dodd · · Score: 4, Interesting

      octave + gnuplot + LaTeX = absolutely beautiful plots in anything I submitted (homework assignments, term papers) in grad school.

      To get you started (there could be errors here, I'm doing this from memory, but Octave code something similar to this:

      plot blah
      hold on
      plot something
      plot otherstuff
      hold off

      gset term postscript eps color 22
      gset output someplot.eps

      replot

      gset output foo %bad shit happens to your plot output if you don't change the output file when setting the term back to X11
      gset term x11

      Would do the following:
      Plot multiple things in a plot to the screen
      Output that plot to an EPS file
      Reset the output so the next plot would go back to the screen

      You could then run the .eps files through epstopdf, write some document in LaTeX that included your plots by their basename (i.e. without the .pdf extension in the document), and use pdflatex to generate a nice PDF file complete with clickable cross references

      (There are a lot of details I'm not mentioning here of course, unfortunately there really isn't any single good central HOWTO for doing all sorts of useful stuff in LaTeX.)

      --
      retrorocket.o not found, launch anyway?
    9. Re:wow! by T-Ranger · · Score: 2, Informative

      Its not GNUPlot. Gnuplot, or gnuplot, sure. But it has exactly nothing to do with GNU.

    10. Re:wow! by zippthorne · · Score: 2, Interesting

      Indeed. Also, Matlab runs on linux, and has latex pretty-print modes. So you don't have to get all confused learning the quirky similarities between Octave and Matlab is you don't want to.

      And LyX is very convenient. Especially for typesetting those pesky equations. Much less flaky than MS Office, or even OO.org. In fact, I'd classify its equation modes as not flaky at all. Of course, it's convenient that anything they don't support can simply be escaped and typed in pure latex...

      My favorite thing about LyX is that even if you have a lot of pictures and included files, when you insert new elements, old elements (like graphics or text-boxes) don't go flying all over the document depending on how you've anchored them.

      --
      Can you be Even More Awesome?!
    11. Re:wow! by orangepeel · · Score: 1

      Nice examples! However, I couldn't help but notice that there is a typographical error in the first example you posted a link for. I believe the word you wanted was "Antarctica" but the graph instead shows "Antartica" (it's missing a "c").

      And now back to your regularly scheduled program...

      --
      Whoever designed level 61 in Frozen Bubble is a sadistic bastard.
  4. So close by niceone · · Score: 5, Funny

    Ah, the summary was so close to getting the words 'perl' and 'readable' in the same sentence (possibly for the first time), but just couldn't quite pull it off.

    1. Re:So close by 26199 · · Score: 2, Insightful

      Heh. Congrats on being modded 'interesting' for that.

      Any chance I can get funny moderation? Or insightful, maybe?

    2. Re:So close by $RANDOMLUSER · · Score: 2, Funny

      Of course, "readable" was referring to the charts, not the Perl, which, as everyone knows, is write-only.

      --
      No folly is more costly than the folly of intolerant idealism. - Winston Churchill
    3. Re:So close by Anonymous Coward · · Score: 0

      I can read (non-obfuscated) Perl code just fine. I recently took over the maintenance of a 10K line codebase from someone else, and had very little problems with it (my main gripes with it were at the design and algorithm levels, not the actual implementation or code syntax).
      I can also go back several years and not only understand the Perl code I wrote, but modify it for use in current projects.
      Ironically, when I look at Python code, it seems artificial and less clear to me than the average Perl or C codebase.

    4. Re:So close by niceone · · Score: 1

      Heh, I was going for funny (I use perl every day), but I'll take interesting too.

    5. Re:So close by 26199 · · Score: 1

      I use perl more or less every day, too. See my sig ;)

  5. hmm by Nutty_Irishman · · Score: 1

    Using the power of GD and Perl, you can link various data and images together to create sophisticated charts that will help bring visual interest to your applications And if you really considered yourself a Perl programmer, you'd be able to do it all in one line of code.
    1. Re:hmm by 26199 · · Score: 1

      There's always Acme::Bleach if you're having trouble making it a one-liner.

    2. Re:hmm by myowntrueself · · Score: 1

      And if you really considered yourself a Perl programmer, you'd be able to do it all in one line of code.

      I wasn't under the impression that Perl *required* newlines anywhere.. can't you just take an existing perl script, delete all newlines and it will compile/run just as before?

      --
      In the free world the media isn't government run; the government is media run.
  6. For the Pythonista wanting charts and graphs... by MarkEst1973 · · Score: 2, Informative

    ... there's matplotlib and there's reportlab for PDFs. Both are excellent open source packages, and I can tell you from experience that reportlab has outstanding support. I recently posted a question to their mailing list and received three intelligent replies within an hour.

  7. Re:I wish a "slashvertisement" tag could exist (n/ by Anonymous Coward · · Score: 0

    Nothing is being sold. The software is free. Should articles about Linux kernels and other OSS be tagged as you suggest?

  8. ChartDirector by rishistar · · Score: 2, Interesting

    I was looking for graphing and charting stuff last year. The only thing I found at the time was ChartDirector. There have been a couple of other open source ones posted above that I may investigate in future, but finding this was what I needed at the time.

    --
    Professor Karmadillo Songs of Science
    1. Re:ChartDirector by Basje · · Score: 1

      I second that. I've dabbled with perl and GD and several other graphics modules for perl, but ChartDirector is the only one to easily produce good looking, anti aliased graphs. So we used that.

      But our product is commercial. I would really love to see a solution for my OS projects. The aa in the article is horrible, GD just doesn't cut it.

      --
      the pun is mightier than the sword
  9. We all know... by ytm · · Score: 5, Funny

    ...that pie charts are evil. However there are exceptions, like this one: http://themot.org/gallery/d/58721-1/pacmanchart.pn g. Most informative.

  10. from the make-a-pac-man-pie-chart-now dept. by schnipschnap · · Score: 1

    In case you missed the memo.

  11. Killing an ant with a thermonuclear bomb... by Anonymous Coward · · Score: 0

    Using Perl to do an org chart?

    1. Re:Killing an ant with a thermonuclear bomb... by Bodrius · · Score: 4, Funny

      Yeah, it does seem a bit overkill.

      If you're organization is so dynamic that your org. chart NEEDs to be generated at runtime by a script on your web server, then maybe writing perl scripts to auto-generate org charts shouldn't be your highest priority.

      --
      Freedom is the freedom to say 2+2=4, everything else follows...
  12. The right tool for the right job by espressojim · · Score: 4, Insightful

    Remember how programmers always talk about using the right tool for the right job?

    If you want to do something like graphing, then why not learn a language like R, where you can easily and interactively create amazing visuals in very little time? I write code in Java, python, bash, and interact with Oracle and MySQL database. R fits in as a nice way to visualize data, and it's very easy to script up solutions that you can plug into your programming pipeline.

    Check out http://addictedtor.free.fr/graphiques/index.php for examples (with source code)

    1. Re:The right tool for the right job by suv4x4 · · Score: 1

      Remember how programmers always talk about using the right tool for the right job?

      If you want to do something like graphing, then why not learn a language like R, where you can easily and interactively create amazing visuals in very little time? I write code in Java, python, bash, and interact with Oracle and MySQL database. R fits in as a nice way to visualize data, and it's very easy to script up solutions that you can plug into your programming pipeline.


      There's Flash for Linux/Windows/Mac, and it can render animated charts with filters, dynamic ordering and show details on demand.

      I really doubt someone beats that (and Java doesn't beat that, for 20 times the size it's 20 times harder to pull off the same results there).

    2. Re:The right tool for the right job by espressojim · · Score: 1

      Yeah. You can render data. But you need to do analysis to determine how to render data. It's more complicated than picking where to draw each pixel. I see there are tools to export Excel into flash, what's the big deal there?

      The examples I can find in flash are 1-2 liners in R. Seriously, plotting a bar graph or pie graph or scatter plot is 2 lines (1 line input the data, 1 line to plot the graph.) Now, do something complicated and interesting as shown above. Do a multi-dimensonal plot. Do a box and whiskers plot (again, a 1 liner in R) that calculates medians, quartiles, etc.

      Unless you're just doing "I could punch that out in excel in 3 minutes" style graphs.

      So, I researched your flash suggestion. Did you even click on the link I provided before you said "Oh, flash can do it!"

    3. Re:The right tool for the right job by hey! · · Score: 1

      The right tool for the job is often the one you have in your toolbox that will do the trick.

      Yes, you don't use your nice new wood chisel to pry the lid off a can of paint. But you might use it instead of driving down to the home depot to get a specialized router attachment, if you can do the job with the chisel in less time than the drive would take. If you plan on doing this operation hundreds of times over the next few months, then by all means drive down to the store and get the specialized attachment.

      Likewise, I might choose to drive a carpet tack with a claw hammer and set it with a nail pumch rather than going to the store to buy a tack hammer, provided I'm only doing a few.

      --
      Post may contain irony: discontinue use if experiencing mood swings, nausea or elevated blood pressure.
    4. Re:The right tool for the right job by suv4x4 · · Score: 3, Interesting

      The examples I can find in flash are 1-2 liners in R. Seriously, plotting a bar graph or pie graph or scatter plot is 2 lines (1 line input the data, 1 line to plot the graph.) Now, do something complicated and interesting as shown above. Do a multi-dimensonal plot. Do a box and whiskers plot (again, a 1 liner in R) that calculates medians, quartiles, etc.

      Lookup Flex Charts. An open-source Flash library for rendering charts, by Adobe.

      It can renders charts if you just feed it the data (in XML format) and what chart type you want.

    5. Re:The right tool for the right job by SCHecklerX · · Score: 1

      gnuplot works for me.

    6. Re:The right tool for the right job by Anonymous Coward · · Score: 0

      Remember how programmers always talk about using the right tool for the right job?

      If you want to do something like graphing, then why not learn a language like R


      What an irony. The task at hand is summing 5 and 3 and you offer that we learn MathCAD to calculate it.

  13. Yes, actually. by Erris · · Score: 2

    With a general purpose language tied to a drawing library I can make custom graphics? Holy crap, who would have thought.

    LibGD was made for this but does more now. There are lots of applications to do the same but "use libGD" is a good tip for people who want to make dynamic images and graphs for web pages from data.

    For those of us who just want to generate some simple graphs for papers and such, what do people use? I've messed with Excel, gnuplot, R, and now I'm using ploticus.

    gnuplot is very powerful. It has fitting with regression analysis, reports reduced chi squared and other math muscle stuff for papers all from text files.

    Gnumeric is a good replacement for excel. It's resource light and the math is correct. It does simple graphs for papers and such.

    --
    DMCA, Hollings, Palladium. What might have sounded like paranoia is now common sense.
  14. Ruby / Gruff by carlivar · · Score: 2, Informative

    Or use Ruby with Gruff.

    --
    Vote Libertarian
    1. Re:Ruby / Gruff by Anonymous Coward · · Score: 0

      Gruff: "You can now graph negative numbers"

  15. Very useful... by A+beautiful+mind · · Score: 1

    I've been using Charts::* for my needs, these look much better. No functionality improvement, but looking better is sometimes a criteria.

    --
    It takes a man to suffer ignorance and smile
    Be yourself no matter what they say
  16. SVG and ImageMagick by Ysangkok · · Score: 2, Insightful

    I make my PHP scripts output SVG. I feed it to ImageMagick's "convert", and then outputs it to the user.

  17. Bugzilla way. by Vo1t · · Score: 1

    Perl and GD. That's how charting is done in Bugzilla. Can't say it's superior, but it fits the needs. If I ever write something in Perl that would require charting then I might resort to GD.

    For now, I'll avoid Perl if I can.

  18. What's the "GD" for? by iminplaya · · Score: 1

    Every time you say "Goddammit!" when you try to run it? I gotta see what happens with this

    --
    What?
  19. How does one do this in HTML? by Anonymous Coward · · Score: 0

    How can one create graphs and charts in html? I'd like to be able to do this for a web project I'm doing.

    1. Re:How does one do this in HTML? by LordLucless · · Score: 2, Informative

      You don't. You use a library like GD and a scripting language to generate the charts as images(alternatively, if your chart is representing static data, you can just whip up a static image in excel/gnuplot/whatever). There are also libraries built on top of GD (I use jpGraph with PHP) which simplify the process.

      You can probably emulate a bar graph using tables, if you're particularly anal about doing it in HTML. Hell, you could probably do a line graph with a whole tonne of 1-pixel cells in a table, but I wouldn't recommend it.

      --
      Just because you're paranoid doesn't mean there isn't an invisible demon about to eat your face
  20. It is a little late by slugstone · · Score: 0, Redundant

    I did something like this over 3 year ago. It even use Apache and Mysql.

  21. This would have been so much simpler by sulimma · · Score: 1

    using Octave or SciLab.

  22. These charts look like shit? No they don't. by matt+me · · Score: 2, Interesting

    Those charts look pretty hot to me. Did you look at the chart in the page? http://www-128.ibm.com/developerworks/opensource/l ibrary/os-perlgdchart/pie_step1_step2.gif
    ). Anti-aliased lines and text :]

    Let's compare this to what I'd get if I asked most professionals for a chart. (These were the first ones from google). The lack of anti-aliasing hurts one's eye, these all look like they're from 1995.
    http://support.alphasoftware.com/images/XD_Interac tive_Pie_Chart.gif
    http://msdn2.microsoft.com/en-us/library/aa192481. odc_vststockallocation2003_fig03(en-us,office.11). gif
    (the second one is 3d)

    And in response to your comment
    > When will open source advocates learn to delegate the graphic design aspect of their work to professionals? if only the programming types in charge of these projects would admit they're better at making code than graphics.
    You seem to have missed the point. The article is about free software that can be used by professional and non-professional alike to create some hot graphics. Perhaps you're referring to the ugliness of the original tux logo? It's not 1995, and developers aren't resigned to producing their own graphics. If you look all free software houses pushing their brand use professional designers. Think of the firefox logo (2004)
    http://www.hicksdesign.co.uk/journal/branding-fire fox
    or of ubuntu and gnome's curves, and check out the tango project http://tango.freedesktop.org/
    Desktop linux has never looked so sexy.

    Why so sour, AC?

    1. Re:These charts look like shit? No they don't. by Anonymous Coward · · Score: 0

      Jon Hicks? The graphic designer who was happy to do Firefox's branding, but eventually dumped it as a browser in favor of Safari, because, among other reasons, the Firefox team has its head up its ass when it comes to taking UI suggestions from people who are skilled at user interface design, but don't necessarily have the time or inclination to learn C++ and XUL as a side hobby?

      That Jon Hicks? Yeah, I think that makes my point.

    2. Re:These charts look like shit? No they don't. by Anonymous Coward · · Score: 0

      That's OK, the Mozilla team have their heads up their asses on a lot of issues, not just graphics design. Look at bugzilla #374002 at bugzilla.mozilla.org (Note: they won't accept links from slashdot, so I won't even bother).

  23. Use JPGraph instead by yahyamf · · Score: 2, Informative
    JPGraph uses PHP and GD, and they have dozens of very fancy graphs along with excellent documentation and code examples. You can have beautiful looking graphs in a few minutes with less than a screen full of php code.

    I think it's dual licensed, with a very modest fee for commercial use.

    1. Re:Use JPGraph instead by Teddy+Beartuzzi · · Score: 1

      XML/SWF charts are gorgeous, easy to use from pretty much any language, and completely free for personal use. I've been very happy with them. XML/SWF charts

  24. Gantt-like chart code by mattr · · Score: 1

    A year ago I went looking for code to draw Gantt like charts (for project scheduling, not the whole kebab).
    I ended up rolling my own in GD with perl (making a wxPerl gui app). Reading this made me think (why doesn't he put it on CPAN) and then my next thought was (maybe I should put my own code up there before talking).

    Not sure when I'll have time but anyway keep up the good work.

    For everyone talking about design, yes it would not be a bad thing to take a first step to seeking designers interested in working on open source projects. Probably a bunch at every design department of a university and even high school maybe. Professionals may do it on their free time. Even choosing colors that go well is nice, and having a designer do a mockup of what they think it should look like might be enough for a programmer to grab on to.

    It might be nice if there was an easier way to build charts (and yes I know JPGraph) but it seems you always want something custom in there, and only the person actually using it will know for sure if it is enough. Some more perl-based pluggable tools on CPAN for this would be a boon to a lot of people.

    Incidentally I've done this before with driving the gimp from a perl program designed interactively with a readline-based gimp shell. It worked fabulously, and composited 1000 photos and as many html pages in about 5 minutes. But it was a one-off job. A simpler way to drive these tools (natural language based?) and get them configured would make them more accessible to people.

  25. Do you like my dynamic GD::Graphs? by maccallr · · Score: 1
    TFA is hardly news, but whatever... here are some of my dynamic plots with GD::Graph. Comments welcome.

    They're quite pretty in my opinion, but having read this thread, I realised they are not anti-aliased and that's not easy to do in GD::Graph at the moment (while drawing the lines, at least - I just read there is a trick one can do with resampling a 4x image).

    Also, there's a problem with the lines not really being the desired thickness perpendicular to the direction of the line...

    It was dead easy to get working though!

    1. Re:Do you like my dynamic GD::Graphs? by Anonymous Coward · · Score: 0

      I really don't get what you're trying to say with that first line graph. My best guess is that you take a couple minutes to bang your girlfriend in the afternoon, but you still keep the browser window open. Later in the evening you turn off both your girlfriend and slashdot to play with your wii and your ps3. Then at night you start reading slashdot over your girlfriend's shoulder while you're making out before bed. Then when you wake up in the morning you have a massive woody for slashdot.

  26. Ah, charts in Perl... by glwtta · · Score: 4, Interesting

    I do most of my work in Perl, and the lack of a good chart package has been annoying for a very long time. GD::Graph will give you very basic (and not terribly ugly) line and bar charts relatively quickly, but that's about it; it's missing even rudimentary features that make it less than useful (eg error bars).

    There just isn't a general purpose charting package for Perl that would even come close to JFreeChart. Grace can produce some nice results, but the Perl interface to it is just a wrapper around their terrible command line interface (maybe it's improved in the last few years, but when I tried it it was almost entirely undocumented and nigh-unusable).

    So, if you want publication quality charts you basically still have to learn gnuplot, which is great, but sometimes just a little too involved.

    At least this thread gives a nice summary of what the other languages have to offer: the PHP and Ruby packages aren't faring any better, but Python's matplotlib looks freaking beautiful.

    --
    sic transit gloria mundi
    1. Re:Ah, charts in Perl... by Noksagt · · Score: 2, Informative

      Grace can produce some nice results, but the Perl interface to it is just a wrapper around their terrible command line interface (maybe it's improved in the last few years, but when I tried it it was almost entirely undocumented and nigh-unusable).
      I like grace a lot. I use it through the GUI & occasionally through python, so can't comment extensively on the perl interfaces. Neither Chart::GRACE nor Chart::Graph::Xmgrace seem TOO obscure.

      The command line interface of grace isn't terrible--it is MUCH more powerful than most plotting software which has a GUI. I do agree it is under-documented, though. Fortunately, the developers are very responsive in the forums.
  27. Grace by Noksagt · · Score: 1

    Grace is an excellent free/open source 2D plotting program. It is in Motif, so some might call it "ugly," but I run it on Windows (it is packaged in cygwin), OS X, and linux. It is the most versatile F/OSS package I know of--both in terms of features & in terms of user interaction. In addition to the GUI (which many of the programs you list lack), you can use a command line interface or bindings for python, perl, fortran, C++, OCaml, octave, rlab, etc.

  28. 90ies news by Anonymous Coward · · Score: 0

    I miss the days when slashdot would post actual news. Using perl and GD is something you've been able to do for over a decade. What's next? News about how you can use zlib to compress stuff?

    This place has become a pointless site where you can only read about point releases of the linux kernel and flamebaits of various kinds. And the saddest thing is those articles cause the most comments, thus the most revenue for slashdot, and thus this is what we will see more and more of from this website.

  29. Edward Tufte weeps... by xixax · · Score: 2, Insightful

    Judging by the examples, this brings the readability of Perl into graphs.

    I think I can hear Edward Tufte weeping...

    And the only chart they implement is the pie chart:

    http://www.usf.uni-osnabrueck.de/~breiter/tools/pi echart/warning.en.html

    Xix.

    --
    "Everything is adjustable, provided you have the right tools"
  30. R is very cool by xixax · · Score: 1

    We use R. I t produces visually appealing neat & clean graphics. My only bugbear is that the raster renders are external syscalls and often handle things like fonts and anti-aliasing poorly. We weer also looking at Rserv as a graphing service rather than invoking an R instance each time we want a graph. http://www.r-project.org/

    Xix.

    --
    "Everything is adjustable, provided you have the right tools"
  31. Getting GD::Graph on Windows by cryptor3 · · Score: 1

    I used to use GD::Graph on my Windows-based system, but then the PPMs never got updated for the latest versions of ActivePerl.

    For the longest time I have been without it since I updated ActivePerl, and there was no PPM available for GD::Graph on the ActiveState repository

    http://ppm.activestate.com/BuildStatus/5.8-G.html

    After looking at the site, I found the link at the bottom of this page that says you can install GD from Univ of Winnipeg, and I was able to install GD Graph from their repository.

  32. Marketing/Management friendly... by thedji · · Score: 1

    If you really want the flashing lights, swirling thingies or generally make your charts management friendly, I'd recommend this library for PHP (or for Perl use the SWF::Chart wrapper).

    With enough animated transitions to last you a good 3-4 promotions you should be set :)

    --
    ... and then there were none
    1. Re:Marketing/Management friendly... by commanderfoxtrot · · Score: 1

      The XML/SWF library is pretty good. There's also a Ruby (and Rails) version of the library at http://ziya.liquidrail.com/

      --
      http://blog.grcm.net/
  33. You can draw charts on the client side instead by Anonymous Coward · · Score: 1, Informative

    Some of the open source JavaScript toolkits can be used to draw charts on a browser window with inline SVG and VML. This makes it possible to draw charts on the web browser instead of having the web server draw them.

    Some examples:
    Dojo Toolkit
    I think I've seen a live charting demo on Dojo's official website, but it seems to be no longer there.

    WT Toolkit
    This one seems to be a new project, judging from the activity charts on their SourceForge page. The way they can draw 3D charts (like, pie charts, 3D bar charts) with inline SVG and VML is quite amazing though.

    1. Re:You can draw charts on the client side instead by Anonymous Coward · · Score: 0

      Ooops... I misspoke... I saw Perl::GD and immediately thought about web applications (yes I'm a web developer), because that's what I do every day.

      Looks like you guys are just talking about charts, however.

  34. Welcome to 1998! by Anonymous Coward · · Score: 0

    Wow, Perl and GD...that was big about 10 years ago. And the quality of the graphics produced by GD looks like something that belongs in the past.

  35. Gnuplot?? for other than XY charts? by xtracto · · Score: 1

    Just some weeks ago I was looking for a way to make some plots. I usually use gnuplot but as far as I could see it seemed uanble to do bar plots, pie plots, discrete 3d plots (this is, make Z axxis a set of items instead of a continuos range), radar plots, bubble etc. It seems it is only possible to do point and line plots.

    I looked for some tutorials on the web to do bar plots but they consisted in half assed hacks (translate the data point, surround it by a bounding box etc etc) which is too much work for something which should be quite trivial to do.

    I ended using Excel to do my plots (I gave a try to Gnumeric, which has quite nice plotting tools, but they were unstable, specifically the area plots).

    --
    Ubuntu is an African word meaning 'I can't configure Debian'
    1. Re:Gnuplot?? for other than XY charts? by Coryoth · · Score: 1

      Bar charts work just fine. For fancier plotting options your best bet is R.

  36. Gnuplot rocks by tbuskey · · Score: 1

    It's scriptable, can do some calculations, does time series, has multiple outputs and is cross platfor.

    My intro was on DOS plotting time series data to screen or an Epson MX80 printer.
    I used Excel (4) which had serious issues with time series and Kaleidagraph on a Mac.

    It's always there on Unix and I think there is/was a macintosh version.

    gnuplot is timeless.

    That said, for long term time series with thousands of data points, I like RRDtool. It deals well with consolidating the data.

  37. AIX & the GD library by Corrado · · Score: 1

    [rant]I would be much more happy with AIX if they included a recent version of GD. As it stands, the version available for AIX 5.3 is so old it doesn't even have GIF support, and that makes a bunch of applications angry. Bugzilla for one doesn't like the version of GD that's available on AIX. I even tried compiling it myself, but ran into really weird font errors. Grrrr....sometimes I don't like AIX. [/rant]

    --
    KangarooBox - We make IT simple!
    1. Re:AIX & the GD library by Intron · · Score: 1

      If you have the IBM-compiled perl, you need the IBM compiler. If you only have gcc, you are better off recompiling perl if you want to add cpan modules.

      --
      Intron: the portion of DNA which expresses nothing useful.
    2. Re:AIX & the GD library by Corrado · · Score: 1

      Yup, I re-compiled Perl with GCC and everything. Blech - I wish IBM would get their stuff straight! :/

      --
      KangarooBox - We make IT simple!
    3. Re:AIX & the GD library by Intron · · Score: 1

      I needed to get perl/tk installed on AIX once. I feel your pain.

      --
      Intron: the portion of DNA which expresses nothing useful.