Lifetime prices rise on 19 October →
Phox Elements
NEW Part-to-whole charts for Breakdance

Show how a whole splits up with bars, waffles and ranges

Proportion Bar turns a list of values into a stacked bar, a 10 by 10 waffle or a range track. Percentages are worked out on the server and always add up to 100. Use it for budgets, survey results, shares and simple project plans.

Bar, waffle and range modes No JavaScript needed Colours follow your site
Live demos

Three proportion charts built with the element

A budget bar with a fixed total, a waffle chart of survey results and a year plan on a range track.

Bar, legend on the right

Monthly household budget

A fixed total of £2,400 with four segments. The £240 left over shows as the track and gets its own Unallocated row in the legend, with values and percentages.

  • Rent£1,08045%
  • Groceries£48020%
  • Bills£33614%
  • Savings£26411%
  • Unallocated£24010%
Waffle, 10 x 10

How 100 staff get to work

Each cell is one per cent. The fifth segment uses the hollow outline style from the default palette.

  • Car38%
  • Bus24%
  • Cycle17%
  • Walk13%
  • Work from home8%
Range track, one row per segment

Shop refit plan for the year

Twelve monthly units with month labels, set out as a Gantt chart. The Winter sale runs from November to February, so it wraps round to the start of the track.

  • Survey and quotesJan to Feb
  • Design sign-offFeb to Apr
  • Fit-out worksMay to Aug
  • Staff trainingAug to Sep
  • Winter saleNov to Feb
How it works

Three steps to a proportion chart

Pick a mode, add your segments and choose how the legend looks.

1

Pick a mode

Choose Bar, Waffle (10 x 10) or Range Track, and give the chart an accessible title.

2

Add segments

Enter a label and value for each segment, or a start unit and length in range mode. Add display text such as £480 if you want it shown instead of the number.

3

Set the legend

Show the legend below or to the right, with values, percentages or both. Colours come from your site unless you set your own.

Features

What Proportion Bar can do

One element, three ways to show parts of a whole.

Three chart modes

A stacked bar, a 10 by 10 waffle where each cell is one per cent, or a range track split into units.

Percentages that add up

Rounded percentages use largest remainder rounding, so the legend always totals exactly 100%.

Fixed total and remainder

Set a fixed total and the gap between it and your segments shows as the track, with its own legend row.

Gantt style rows

In range mode, give each segment its own row with a label. Ranges that run past the last unit wrap round to the start.

Flexible legend

Place the legend below or to the right, show values, percentages or both, and pick square, rounded, circle or short bar swatches.

Site colour palette

Four default colours and a hollow outline style follow your brand and heading colours. Any segment can have its own colour.

Screen reader summary

The chart has an image role and a label that reads out every segment with its percentage or dates.

Rendered on the server

All maths happens in PHP, so the chart is complete with JavaScript off and adds no script to the page.

Dynamic data

The title, segment labels, values, display text and fixed total all accept dynamic data from custom fields.

Use cases

Where it works best

Anywhere a number makes more sense as part of a whole.

01

Budgets and spending

Show where money goes each month, with an unallocated remainder.

02

Survey results

Present answers from a poll or study as a waffle that is easy to read at a glance.

03

Charity reports

Show how each donation is split between programmes, admin and fundraising.

04

Project plans

Lay out phases across months or weeks as a simple Gantt chart.

05

Seasonal calendars

Mark opening seasons, planting times or campaigns across the year, even when they cross December.

06

Product breakdowns

Show ingredients, materials or storage use as a share of the total.

Settings reference

Every control, explained

This is the full list of settings in the Breakdance editor, with their default values.

ControlWhat it doesDefault
Chart
ModeBar, Waffle (10 x 10) or Range Track.Bar
Accessible TitleDescribes the chart for screen readers.Where every £100 goes
TotalAuto (sum of segments) or Fixed. Not used in range mode.Auto
Fixed TotalThe whole the segments are measured against. If it is smaller than the sum, the sum is used.100
Remainder LabelLegend label for the part of a fixed total not covered by segments.Unallocated
Segments
LabelThe segment name, shown in the legend and in range row labels.—
ValueThe segment amount. Bar and waffle modes.—
Display TextText shown instead of the raw value, e.g. £58.—
Start UnitWhere the segment starts on the range track (1 to 60).—
Length (Units)How many units the segment covers (1 to 60).—
Colour (optional)A colour for this segment instead of the palette.—
Hollow StyleDraw the segment as an outline instead of a fill.Off
Range Track
Number Of UnitsHow many units the track is split into, up to 60.12
Unit LabelsComma separated labels shown under the track.J,F,M,A,M,J,J,A,S,O,N,D
One Row Per Segment (Gantt)Give each segment its own row with a label.Off
Display
Show Values Inside SegmentsPrint display text or the percentage inside each segment. Not used in waffle mode.On
Show LegendShow the legend.On
Legend PositionBelow or Right.Below
Legend Shows ValueAdd each value, or the date range in range mode.On
Legend Shows PercentageAdd each percentage. Not used in range mode.On
Percentage Decimals0, 1 or 2 decimal places.0
Bar & Track
Bar HeightHeight of the bar and the range track rows.36px
Gap Between SegmentsSpace between segments.3px
Outer RadiusCorner radius of the ends of the bar.8px
Segment RadiusCorner radius of each segment.3px
Track / Remainder ColourColour of the empty track, remainder and empty waffle cells.Heading colour at 10%
Hollow Outline WidthLine width for hollow segments.2px
Default Palette
Colour 1 to 4Used in order for segments without their own colour, then a hollow outline, repeating.Brand and heading colours
Hollow Outline ColourColour of the fifth, hollow slot.Heading colour
Text On Filled SegmentsText colour inside filled segments.#fff
Segment Text
TypographyText style inside segments.—
Side PaddingSpace either side of text inside a segment.0.5em
Legend
Label and Value TypographyText styles for legend labels and values.—
Swatch SizeSize of each legend swatch.12px
Swatch ShapeSquare, Rounded, Circle or Short Bar.Rounded
Gap Between ItemsSpace between legend items.8px 20px
Space From ChartSpace between the chart and the legend.16px
Waffle
Cell SizeMaximum size of each cell.22px
Cell GapSpace between cells.4px
Cell RadiusCorner radius of each cell.3px
Range Track (design)
Unit Labels and Row Label TypographyText styles for the labels under the track and the row labels.—
Space Above Unit LabelsGap between the track and its labels.0px
Space After Row LabelsGap between row labels and the track.0.75em
Gap Between RowsSpace between Gantt rows.8px
Spacing
MarginTop and bottom margin.—
Tips & FAQ

Good to know

Do the percentages always add up to 100?

Yes. Rounded percentages are shared out with largest remainder rounding, so the numbers in the legend add up to exactly 100%, with any decimals you choose.

What happens if my fixed total is smaller than the segments?

The chart cannot fit the segments into it, so it uses the sum of the segments as the total instead.

Can a range cross the end of the track?

Yes. If a segment starts in November and runs for four months, it is drawn from November to December and then again from January to February.

Does it need JavaScript?

No. Every width, cell and position is worked out on the server, so the chart shows as soon as the HTML loads.

Can the values come from custom fields?

Yes. The title, segment labels, values, display text and fixed total all accept dynamic data.

Is it accessible?

The chart has role img and a label that lists every segment with its percentage, or its start and end units in range mode. The legend is a normal list.

Add Proportion Bar to your next page

Proportion Bar is included with Phox Elements, along with 140+ other premium elements for Breakdance.