Bar charts script for OmniGraffle

A follow on from my pie-chart making script for OmniGraffle, this one makes bar charts.

Really just quickly thrown together, but it produces the results I was hoping for. Obviously, use at your own risk, and maybe save any OmniGraffle documents you have open before you run it.

Using

  1. Download Applescript icon bar_chart.zip (4 KB).
  2. Install the script.
  3. In OmniGraffle open a new document and select Script > Bar chart.
  4. In the window that appears enter the appropriate data, separated by spaces. It doesn't have to be whole numbers, but it will freak out if you put in negatives. Dialog for data entry
  5. Basic Bar chartHit OK... tada!

Tips and other uses

What you have now is pretty neat, but can easily be made to look a lot better.

Bar chart, with coloured barsChange the fill colour of the bars.

Bar chart; long and thinShoft, fat bar chartScale the chart. Select all the bars, then drag the blue control points around. Holding down shift while doing this preserves the aspect ratio, but the relative height of the bars remains correct even if you don't do this.

Alignment of scale linesIf you are trying to add scale lines to your graph, it may be helpful to add some extra columns to your chart to line them up more easily. The example on the left shows graphing the data 1, 3 and 7. The extra 10 (shown with dotted outline) is added, and lines aligned by hand (using the up and down arrows for fine adjustments) with the top of this, and the bottom of the bars.

A small graph with scale linesAnother three identical lines are added, then distributed evenly, giving a line every 2.5. The bar for 10 can then be deleted. Important scale lines could possibly be made thicker than the others, as shown here. These lines have also been Sent to back so that they appear under the bars. Pleasingly, the graph can still be resized with ease; as long as you select everything, it all stays in proportion.

Suddenly, a histogram appears before usSetting the spacing between the bars to zero produces what is technically a histogram. This is the one to use if you have continuous data like "Hours spent sleeping" with groupings like 0–12, 12–24, etc., whereas with things like "Favourite cheese", where the groupings are discrete, the spaced bar chart is the correct thing.

Maybe add some gradient fills, stack two graphs back-to-back, add more labels and some scale lines, and you can end up with something quite fancy, quite quickly!fancy graph back-to-back, with gradient fills and stuff

Known 'features'

Things to maybe get around to some nice day

Version history

1.1 (2005-04-12)
Fixed a problem where I was comparing the length of numbers, instead of the numbers themselves, which would make some sets of data draw very very tall graphs.
1.0 (2005-02-24)
Initial release. Apparently works with OmniGraffle versions 3.2 beta 1, 3.2 and 3.2.1. Should also work fine with corresponding Pro versions of OmniGraffle.