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 targets Linux professionals.
The Fedora project adds Wayland and Gnome 3.22
CeBIT 2017: Open Source Forum Call for Papers
Long-time Linux antagonist joins the revolution.
Major bug affects Debian/Ubuntu distributions.
Canonical releases the minimal edition for embedded devices, Internet of Things, and cloud deployments.
The new release features improvements across the board, from performance to security.
Two out of three of the new members are women.
More than 5,000 people attended the event.
Linux Magazine will include the best of both magazines.