Gauge#

A Gauge represents a value in some range as a position on speedometer or gauge. It is similar to a Dial but visually a lot busier. Requires the ECharts extension to be loaded.

Use pn.ui.Gauge to create this component.

API#

.. py:class:: Gauge(*, annulus_width, bounds, colors, custom_opts, end_angle, format, num_splits, show_labels, show_ticks, start_angle, title_size, tooltip_format, disabled, loading, align, aspect_ratio, css_classes, design, height, height_policy, margin, max_height, max_width, min_height, min_width, sizing_mode, styles, stylesheets, tags, visible, width, width_policy, label, value, name) :module: panel.widgets.indicators

A Gauge represents a value in some range as a position on speedometer or gauge. It is similar to a Dial but visually a lot busier. Requires the ECharts extension to be loaded.

Reference: https://panel.holoviz.org/reference/indicators/Gauge.html

:Example:

pn.extension(‘echarts’) Gauge(label=’Speed’, value=79, bounds=(0, 200), colors=[(0.4, ‘green’), (1, ‘red’)])

:Attributes:

   **colors**
       ..

   **custom_opts**
       ..

.. !! processed by numpydoc !!

Parameter Definitions


Parameters inherited from:

   :class:`panel.widgets.base.WidgetBase`: label

   :class:`panel.viewable.Layoutable`: align, aspect_ratio, css_classes, design, min_width, min_height, max_width, max_height, styles, stylesheets, tags, width_policy, height_policy, visible

   :class:`panel.viewable.Viewable`: loading

   :class:`panel.widgets.base.Widget`: margin, disabled

   :class:`panel.widgets.indicators.Indicator`: sizing_mode

value = Number(allow_None=True, default=25, inclusive_bounds=(True, True), label='Value')

  Value to indicate on the gauge a value within the declared bounds.

height = Integer(allow_None=True, bounds=(0, None), default=300, inclusive_bounds=(True, True), label='Height')

    The height of the component (in pixels).  This can be either
    fixed or preferred height, depending on height sizing policy.

width = Integer(allow_None=True, bounds=(0, None), default=300, inclusive_bounds=(True, True), label='Width')

    The width of the component (in pixels). This can be either
    fixed or preferred width, depending on width sizing policy.

annulus_width = Integer(default=10, inclusive_bounds=(True, True), label='Annulus width')

  Width of the gauge annulus.

bounds = Range(default=(0, 100), inclusive_bounds=(True, True), label='Bounds', length=2)

  The upper and lower bound of the dial.

colors = List(allow_None=True, bounds=(0, None), item_type=<class 'tuple'>, label='Colors')

  Color thresholds for the Gauge, specified as a list of tuples
  of the fractional threshold and the color to switch to.

custom_opts = Dict(allow_None=True, class_=<class 'dict'>, label='Custom opts')

  Additional options to pass to the ECharts Gauge definition.

end_angle = Number(default=-45, inclusive_bounds=(True, True), label='End angle')

  Angle at which the gauge ends.

format = String(default='{value}%', label='Format')

  Formatting string for the value indicator.

num_splits = Integer(default=10, inclusive_bounds=(True, True), label='Num splits')

  Number of splits along the gauge.

show_ticks = Boolean(default=True, label='Show ticks')

  Whether to show ticks along the dials.

show_labels = Boolean(default=True, label='Show labels')

  Whether to show tick labels along the dials.

start_angle = Number(default=225, inclusive_bounds=(True, True), label='Start angle')

  Angle at which the gauge starts.

tooltip_format = String(default='{b} : {c}%', label='Tooltip format')

  Formatting string for the hover tooltip.

title_size = Integer(allow_None=True, default=18, inclusive_bounds=(True, True), label='Title size')

  Size of title font.