Skip to content

plotly/gauge-indicator

Pack Severity Fix Versions
plotly info, and warning with style = "strict". A rule of the house style none, edit by hand All versions

A gauge spends a whole dial on one number. Show the number with mode="number+delta", or put a series of values in one small chart.

fig = go.Figure(go.Indicator(mode="gauge+number", value=270, gauge=dict(axis=dict(range=[0, 500]))))
fig = go.Figure(go.Indicator(mode="number+delta", value=270, delta=dict(reference=250)))

The rule reports go.Indicator whose mode is a string that names gauge, such as mode="gauge+number".

xpd has no automatic fix, so make the change by hand.

"Maximize data density and the size of the data matrix, within reason" (page 168). The book calls a graphic that "purveys Graphical Style rather than quantitative information" a duck (page 116), and a gauge draws a dial around one number.

go.Indicator Shapes drawn Labels drawn
mode="gauge+number" 8 7
mode="number", the default 0 2

plotly draws the dial only when mode names it. The rule does not report a gauge argument with the default mode, because it drew no shape. A gauge with shape="bullet" is a bar and not a dial, and is left alone. The rule has no fix, because a gauge can carry a threshold that the number alone does not show.

The rule reports in code what these questions of the presentation guides (xpd charts, xpd tables, and xpd views) ask of the drawn display.

Question Page Principle What it asks
duck 116 The duck Has decoration taken over the chart, so that its structure is a style rather than data?
many-numbers 168 Data density and the shrink principle How many numbers does the chart show for its area, and could it show more data, or the same data in less space, while it stays legible?
A gauge spends a dial on one number. mode="gauge+number" drew 8 shapes and 7 labels for a value that mode="number" shows with 2 labels. Tufte asks for more data in the same space, and calls a graphic that sells style a duck. Show the number with mode="number+delta", or put a series of values in one small chart.

See all rules in the plotly pack.