In-cell Charting in Calc
In-cell charting is not a new idea: do a quick Web search, and you'll find quite a few examples of how to create in-cell charts. While most of these examples are designed to work with Excel spreadsheets, you can easily use in-cell charting techniques in Calc. As the name suggests, an in-cell chart is a bar graph where each bar occupies a separate cell. Each bar represents the value from another cell, and the bar itself is generated using the REPT function which is normally used to insert a particular character or string a specified number of times. To make the REPT function create a chart bar, you can use the pipe (|) as the repeating character. To see how this work, create a new Calc spreadsheet, click on the B1 cell and enter the following function in the Formula field:
Now enter a number in the A1 cell, and you should see a bar in the B1 cell.
To make the bar appear as a solid block, you can use the rectangular character (ASCII code 219). There are plenty of other interesting variations of this basic technique out there, but my favorite in-cell charting trick is the one described on the Pointy Haired Dilbert blog. It uses a special font to create rather nifty bar charts. Again, the description on the blog covers Excel, but you can apply it to Calc. First of all, you have to download and install the barchart font. Since the font presents values from 0 to 9 as bars, you need to normalize the data in the cell range to these values. For example, to normalize data in cell A1 in the A1:E1 cell range, use the following formula:
For the B1 cell the formula is =ROUND(B1/MAX(A1:E1)*9), and so on. To generate a bar chart, you have to create a formula that concatenates the normalized value. For example, assuming that normalized values are stored in the A2:H2 cell range, the concatenation formula looks like this:
Apply the barchart font to the cell containing the formula, and you are done.comments powered by Disqus
The Raspberry Pi Foundation has announced an even smaller version of the tiny computer that will fit into a DIMM slot.
A new class of problems lets a malicious app pre-configure an invisible privilege update.
New Hack language adds static typing and other conveniences.
New crypto policy system will offer easier configuration and more uniform security.
Ubuntu founder denounces insecurity in proprietary, close-source software blobs.
Vulnerability affects many Linux web servers
The Bavarian capital shuns Microsoft, Google, and other alternatives to implement an open source groupware solution.
Phone vendor partnerships bring Mark Shuttleworth's dream of Ubuntu on a phone a step closer to reality.
Donors will get to vote on new features for the free video editor.
Debian project puts init out to pasture and says no to Ubuntu's Upstart.