Skip to main content

GaugeMarker

A line, with an optional label, that marks a single value on the arc of a GaugeChart, such as a threshold or a target.

Markers are positioned like ticks, but each one sits at its own value instead of being spaced evenly. They are drawn over the ticks and under the pointers.

Properties

  • alignment - Where the line sits relative to the point it marks on the arc.
  • color - The color of the line.
  • label - The text drawn next to the line.
  • label_offset - The distance, in logical pixels, between the end of the line and the label.
  • label_side - Which side of the line the label sits on.
  • label_style - The text style of the label.
  • length - The length of the line, in logical pixels.
  • offset - The distance, in logical pixels, by which this marker is moved from its position.
  • position - Where this marker sits relative to the rings.
  • stroke_cap - The shape of the ends of the line.
  • thickness - The thickness of the line, in logical pixels.
  • value - The value on the gauge's scale this marker sits at.

Properties​

alignmentclass-attributeinstance-attribute​

Where the line sits relative to the point it marks on the arc.

colorclass-attributeinstance-attribute​

color: ColorValue | None = None

The color of the line.

Defaults to ColorScheme.on_surface.

labelclass-attributeinstance-attribute​

label: str | None = None

The text drawn next to the line.

On the left half of the gauge, the label is turned by 180 degrees so that it stays upright.

Note

Only the line is taken into account when the rings shrink to leave room for markers at GaugeTickPosition.OUTER. To keep an outward label from being clipped, increase offset.

label_offsetclass-attributeinstance-attribute​

label_offset: Number = 6.0

The distance, in logical pixels, between the end of the line and the label.

Raises:

  • ValueError - If it is not greater than or equal to 0.

label_sideclass-attributeinstance-attribute​

Which side of the line the label sits on.

label_styleclass-attributeinstance-attribute​

label_style: TextStyle | None = None

The text style of the label.

Defaults to 12-pixel text in the marker's color.

lengthclass-attributeinstance-attribute​

length: Number = 10.0

The length of the line, in logical pixels.

Raises:

  • ValueError - If it is not strictly greater than 0.

offsetclass-attributeinstance-attribute​

offset: Number = 0

The distance, in logical pixels, by which this marker is moved from its position.

It follows the same rules as GaugeTicks.offset.

positionclass-attributeinstance-attribute​

Where this marker sits relative to the rings.

stroke_capclass-attributeinstance-attribute​

stroke_cap: StrokeCap = StrokeCap.ROUND

The shape of the ends of the line.

thicknessclass-attributeinstance-attribute​

thickness: Number = 2.0

The thickness of the line, in logical pixels.

Raises:

  • ValueError - If it is not strictly greater than 0.

valueinstance-attribute​

value: Number

The value on the gauge's scale this marker sits at.

A value outside GaugeChart.min_value and GaugeChart.max_value places the marker past the ends of the arc.