Line graphs script for OmniGraffle
Another box ticked in the 'graphs you can draw with OmniGraffle' list. Work in progress this chap, but then, so are they all! At least I don't call it a beta forever and ever and ever, when it obviously works OKish... (*cough*Flickr*cough*).
- Download line_graph.zip (8 KB).
- Install the script.
- In OmniGraffle open a new document and select > Line graph.
- In the window that appears enter the appropriate data, separated by spaces. It doesn't have to be whole numbers.
- Hit OK... tada!
Tips and other uses
The horizontal lines on the graph are the highest value, zero and (if the lowest value is not zero) the lowest value. Note that if your lowest value is negative, then the middle line will be the zero one.
Select it all, and drag the handles to make it bigger - it all stays in proportion. I'd like to say I spent ages scripting this behaviour in by hand, but I can't, because OmniGraffle just works this way.
Scales can be added much in the same way as they can be with the bar chart script. A full explanation of how to do that nicely is on that page. The lines that are drawn by the script serve as a useful guide for making the ones for the scale. Just duplicate one of them the number of times that you want scale lines, then Distribute space between the lower and higher ones. (Not the best explanation; check out the bar chart page which should hopefully help.)
The vertical lines here are aligned with the start and end points of the graph by hand; these will hopefully be done by the script in the next version, as they're quite handy too.
The finished product! Yes, this did take some time. If you don't have the time, use Excel. It'll be ugly; it's a compromise. Hopefully later versions of this script should make the process simpler.
(No idea what the Y axis represents here. It could almost be sunshine, if the UK were lower than France.)
Note: The observant amongst you will have noted that using a line chart for the discrete data set here (countries) makes no sense. There is no data for half-way between UK and France, so it doesn't make sense to have a value associated with it. Also, two Frances dost not maketh an Iceland. You'd be right. I just wanted an excuse to use John Oram's excellent map stencils. Looking forward to those being a standard part of the next version of OmniGraffle!
- There is no error checking. As such, if you do anything out of the ordinary the script will almost certainly give strange—or no—results. Obvious things which come to mind which will confuse it are putting in negative numbers, or words. If you do do something funny, OmniGraffle will give you the option to edit the script. Feel free! Let me know if you come up with anything great.
- Multiple graphs are always drawn in the same place. Best to move your graph once it's been drawn if you are doing more than one. Grouping the bits together makes this (and aligning multiple graphs) much easier.
- It can be a little confusing to figure out which line is the zero one, and which is the highest. Best to change them somehow right after creating your graph, while the data is fresh in your mind.
- No lines are automatically drawn that line up with the data points on the X axis. This will be addressed in the next version, hopefully in 'a few days', whatever that means.
Things to maybe get around to some nice day
- Allowing comma-separated data.
- Allow data to be read from a file.
- Draw vertical lines aligned with the first and last points.
- Draw labels.
- Maybe some error checking here and there might be a good idea.
- Different style of line for the zero one
- Make multiple charts not all draw one on top of the other.
- Area charts (i.e., the same as this, but with the bit 'under' the line filled in) are a trivial modification of this script. Should get that done sooner rather than later. (Writing these pages takes longer than the scripts!)
- Other suggestions and comments are more than welcome.
- John Oram for prodding me into action on this one.
- 1.0 (2006-02-28)
- Initial release. Apparently works with OmniGraffle versions 4.1.1. Should also work fine with corresponding Pro versions of OmniGraffle.