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
Xen project announces a privilege escalation problem for Qemu host systems
Attackers can compromise an Android phone just by sending a text message
PC vendor will pre-install Ubuntu on portables in India.
More embarrassment for Adobe's embattled multimedia tool
Mozilla’s script blocker add-on could be putting malware sites on the whitelist.
The Internet community officially banishes the notoriously unsafe Secure Sockets Layer protocol.
Popular desktop environment continues the Gnome 2 legacy – with new support for the Gnome 3 toolkit.
The Obama White House has issued a memorandum telling all US government agencies they must use HTTPS for all websites and web communication.
New program will dial up security for the Firefox browser.
Red Hat's community distro embraces the cloud.