Pepping up OOo Writer documents with sparklines

Big graphs are not the only way to visualize data in a text document. Using a couple of tricks, you can spice up your OpenOffice.org Writer documents with sparklines – word-sized graphs embedded into text. Developed by infographic guru Edward Tufte, sparklines provide a simple yet effective way of visualizing data directly in the text body of the document.

Although OpenOffice.org doesn’t provide a dedicated sparkline feature, there are several ways to add sparkline graphics to your documents. For starters, you can manually construct sparklines using OpenOffice.org’s own charting tools.


Figure 1: The Chart Data window

In your Writer document, place the cursor somewhere in the text where you want the sparkline to appear, choose Insert → Object → Chart, and press Create without changing anything. Now select the inserted chart by double-clicking on it (you should see a thick gray border around the chart), then right-click on the chart and select Chart Data. Remove the excessive columns, add rows you need, and enter the desired values in the cells (Figure 1).


Figure 2: Editing the chart

Select the inserted chart by double-clicking on it, and use the Formatting toolbar to turn off Title, Legend, Axes Titles, and Axes Descriptions. Next, click to select the Y axis, then double-click on it to evoke the Y Axis properties window (this can be a bit tricky, so it may take a couple of attempts to get it right). Under the Line tab in the Line Properties section, set Style to Invisible. Now select the chart bars, right-click on them, select Object Properties, switch to the Area tab and select the desired color (stark solid colors like blue or black work best with sparklines).

Next you have to resize the created sparkline chart and place it in the text. To do this, click on the chart once (you should see green handles around it), right-click on it, and select Object. Specify the Width and Height values.


Figure 3: Configuring the chart’s options

You can start with something like 3.5cm x 0.5cm and then tweak the values for better results. In the Anchor section, select the As character option, and set the Vertical position to Top/Base Line in the Position section (Figure 3). Press OK to save the settings and close the dialog window. Now place the sparkline chart in the text, and you are done. The final result should look like in figure 4.


Figure 4: The final result

This technique works fine if you need to create sparklines every now and then, but it involves too many steps to be practical for use with sparkline-intensive documents. In those cases, you would be better off using a tool that allows you to generate sparklines as images ready to be inserted into your document. There are, in fact, several sparkline generators suitable for the job. BitWorking Sparkline Generator is probably the most sophisticated tool for creating sparklines. It is available both as a Web application and a CGI script which you can deploy on your own server. The main advantage of BitWorking’s generator is the sheer number of available options that allow you to customize virtually any aspect of your sparkline, including type (line or bar), size, data limits, and colors. The generator creates a sparkline on the fly as you type the data or modify settings. Once you’re satisfied with the generated sparkline, download it (on Firefox, right-click on the generated image and choose Save Image As) and insert it into your document.

Related articles:

PageDateUserTags
Better writing with OpenOffice.org and Writer's Tools 2008/03/18 12:24 Dmitri Popov
Create high-quality maps with OOoHG 2007/07/15 18:20 Dmitri Popov , ,
Creating OpenOffice.org extensions the easy way with BasicAddonBuilder 2008/02/26 14:06 Dmitri Popov
Creating an e-wallet with Base 2007/08/16 00:27 Dmitri Popov , , ,
Creating interactive forms with OpenOfice.org Writer 2007/09/07 09:51 Dmitri Popov ,
Digitally sign OpenOffice.org documents 2007/08/16 00:29 Dmitri Popov , ,
Inserting special symbols and characters into OpenOffice.org Writer documents 2008/06/16 16:29 Dmitri Popov
OpenOffice.org Base primer 2007/09/23 13:02 Dmitri Popov , ,
OpenOffice.org Basic code snippet: Insert annotation 2008/06/27 11:31 Dmitri Popov , ,
OpenOffice.org banners and logos 2008/07/04 11:32 Dmitri Popov
Pepping up OOo Writer documents with sparklines 2007/09/07 12:46 Dmitri Popov ,
Scheduling OpenOffice.org Basic macros 2008/03/20 23:54 Dmitri Popov
Scribus for OpenOffice.org users 2007/11/04 17:05 Dmitri Popov , ,
Translate words with EuroOffice Dictionary extension 2008/06/16 01:10 Dmitri Popov , ,
Turning OpenOffice.org into a document conversion tool 2008/01/03 15:09 Dmitri Popov
WNotes: Creating a Writer/MySQL web application 2007/09/20 17:25 Dmitri Popov , ,

AddThis Social Bookmark Button

 
articles/ooosparklines.txt · Last modified: 2008/06/01 16:16 (external edit)
 
OpenOffice.org user? Read the Writer for Writers and Advanced Users book
GNU FDL OpenOffice.org Powered by DokuWiki