0%

Meter

A meter displays bounded numeric values (core.Meter). It is read-only, whereas a slider supports changing the value.

Properties

You can make a meter without any custom options:

core.NewMeter(b)

You can set the value of a meter:

core.NewMeter(b).SetValue(0.7)

You can set the minimum and maximum values of a meter:

core.NewMeter(b).SetMin(5.7).SetMax(18).SetValue(10.2)

Types

You can make a meter render vertically:

core.NewMeter(b).Styler(func(s *styles.Style) {
    s.Direction = styles.Column
})

You can make a meter render as a circle:

core.NewMeter(b).SetType(core.MeterCircle)

You can make a meter render as a semicircle:

core.NewMeter(b).SetType(core.MeterSemicircle)

You can add text to a circular meter:

core.NewMeter(b).SetType(core.MeterCircle).SetText("50%")

You can add text to a semicircular meter:

core.NewMeter(b).SetType(core.MeterSemicircle).SetText("50%")