Not all tables are meant to display numbers. Actually, with a little creativity and some advanced customization, you can create amazing visualizations that will enhance your applications and give a fresh look to your dashboards.
For a strange reason, it looks like most area-based graphics have something to do with food. However, this time, we are not talking about pies or doughnuts, but waffle charts. These visualizations are based on a pivot table and rely on cell customization to display a percentage.
Example: Waffle chart.
Relevant features: ValueLoop()
, RowNo()
, and ColumnNo()
.
Unlike most visualizations, the construction of the waffle chart is a little unorthodox because it is based on two synthetic dimensions (that is, they don't exist in the data model) and a dummy expression. Our objective is to create a matrix with 100 cells that will be displayed in different colors depending on a metric. In order to create a waffle chart, do the following:
=ValueLoop(1, 10)
' '
if(((RowNo() - 1) * 10) + ColumnNo() > (1 - avg(Waffle)) * 100 // Your KPI , RGB(145, 180, 200)) // Color
Based on the same rationale as the one behind a waffle chart, it is possible to create certain types of infographics. The only difference is that instead of using color to display a metric, this graphic displays different images. Though its data-ink ratio will be shockingly low, this visualization is definitely eye-catching and might be useful for specific audiences. (If anyone asks, you didn't hear this one from me.)
Heat maps are one of the most interesting visualizations that can be created upon tables. They display information by coloring a matrix based on a calculation; as the color becomes darker, the magnitude behind it is greater. Though this graphic is not among the most accurate representations of data, it is still very useful to understand distributions and behaviors.
Example: A restaurant wants to spot the busiest hours of the week in order to hire more chefs and waiters so that the quality of the service remains always the same.
Relevant features: ColorMix1()
.
In order to create such a heat map, do the following:
WeekDay
and Hour
as the dimensions.' '
(Yep, again, only a space).Hour
column to the upper border in order to create a cross table, as shown in the following image:ColorMix1()
. This function creates a gradient between two colors based on a number that goes from zero to one, for example:avg(Customers) / $(=max(aggr(avg(Customers), WeekDay, Hour)))
The aggr()
function allows us to iterate over WeekDay
and Hour
, so we can select their maximum value (something similar to a GROUP BY
clause in the script). It is important to highlight that it is mandatory to use the dollar sign expansion here because we need this expression to be calculated at a global level and not in each cell.
ColorMix1()
function. Click on the Expression Expansion icon, open the Background Color parameter, and type the following formula:ColorMix1( avg(Customers) / $(=max(aggr(avg(Customers), WeekDay, Hour))), white(), RGB(0, 70, 140))