How to Create a Waffle Chart
Table of Contents
What is a Waffle Chart
Waffle charts represent a single series of numbers as proportional areas of a wall of bricks. Filling starts from the bottom-right corner to the left, and goes up one row after we complete a row of bricks.
Imagine the wall as a rectangular area of 10 x 5 bricks. The numbers 2, 7 and 1 will then occupy 10, 35 and 5 bricks each. For our example, 2 will use the whole first row of 10 bricks at the bottom, 7 the next 3 and a half rows, 1 half of the remaining top row of bricks.
As these proportions are integer-based approximations, it may happen to have no brick for a non-zero number, but which is too small.
When the query result returns one single value, we automatically show a Waffle Gauge instead: we represent it as a 0..100% percent value on a 100% wall, with a neutral gray color for the bricks left empty.
Steps to Create a Waffle Chart
Start Visual Xtractor or Data Xtractor. Connect to a database. Create or design a SQL query. Run the query and check the results.
- Display and enable the Chart query builder.
- Select a numeric data column as Matrix Charts – Waffle chart.
- Or return one 0..100 value, or choose Gauge Charts – Waffle Gauge instead.
- Select another textual column as Label, for legend labels.
Waffle Chart Demo Query
Look for the ready-to-use Waffle Charts generated query under the Queries > Demo Queries > Charts > Cartesian Charts folder. Click on the “add demo queries” command link, if not there.
Generated demo queries must work for any database, with no restriction. They use constant values generated on-the-fly and your database SQL engine, but do not depend on data from your tables, and never alter your database in any way.
Waffle Gauge Demo Query
It would make no sense to display the full wall with the same color. Or this may happen when the query result returns one single value.
We take this value instead, treat it as a 0..100% percent value and represent the waffle chart as a gauge on the 100% for the whole wall. The bricks left get a gray neutral color.
You may also set the chart type directly as Waffle Gauge, and we skip anything but the first result value.
Look for the ready-to-use Waffle Gauge generated query under the Queries > Demo Queries > Charts > Cartesian Charts folder. Click on the “add demo queries” command link, if not there.
Customize your Waffle Chart
- Change the total number of waffles/bricks on each dimension (default is 10 x 10).
- Switch between 2D and 3D.
- Change the drawing style.
- Click on legend items to hide some items with their portions from the wall.
Conclusion
- Creating a Waffle Chart in Data Xtractor or Visual Xtractor is fast and trivial: set any numeric data column as Waffle, and an optional column as Label.
- Set the chart as a Waffle Gauge instead, or return one single value, and we treat is as a percentage on a 100% wall.
- All builtin powerful features of these chart type are common to most other charts: filtering series through the legend items, interactivity, monochrome or grayscale colors, rich axis and data label selections etc.
- Switch to another builtin chart theme, or customize your own, for any possible color or other styles.