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
New release marks the arrival of AMD’s unified driver strategy.
A new study by IDC charts big changes in the big hardware market.
Azure CTO says Redmond has already considered the unthinkable.
Lead developer quells rumors that the Debian version is slated for center stage.
MSBuild is now just another GitHub project as Redmond continues its path to the light.
Malware could pass data and commands between disconnected computers without leaving a trace on the network.
New rules emphasize collegiality in coding.
Upstart lands in the dust bin as a new era begins for Linux.
HP's annual Cyber Risk report offers a bleak look at the state of IT.
But what do the big numbers really mean?