metric class
A control that provides a visualization for a specific metric.
Methods¶
__init__() ¶
__init__(
value=None,
type="circular",
min=0,
max=100,
delta=None,
delta_color=None,
title=None,
negative_delta_color=None,
threshold=None,
show_value=True,
format=None,
delta_format=None,
bar_color=None,
color_map=None,
width=None,
height=None,
layout=None,
template=None,
id=None,
properties=None,
class_name=None,
hover_text=None,
) -> None
Create a new metric
element.
Parameters:
Name | Type | Description | Default |
---|---|---|---|
value |
Union[int,float]
|
The value to represent. |
None
|
type |
str
|
The type of the gauge.
Setting this value to "none" remove the gauge. |
circular
|
min |
Union[int, float]
|
The minimum value of this metric control's gauge. |
0
|
max |
Union[int, float]
|
The maximum value of this metric control's gauge. |
100
|
delta |
Union[int,float]
|
The delta value to display. |
None
|
delta_color |
str
|
The color that is used to display the value of the delta property. |
None
|
title |
str
|
The title of the metric. |
None
|
negative_delta_color |
str
|
If set, this represents the color to be used when the value of delta is negative (or positive if delta_color is set to "invert"). |
None
|
threshold |
Union[int,float]
|
The threshold value to display. |
None
|
show_value |
bool
|
If set to False, the value is not displayed. |
True
|
format |
str
|
The format to use when displaying the value. |
None
|
delta_format |
str
|
The format to use when displaying the delta value. |
None
|
bar_color |
str
|
The color of the bar in the gauge. |
None
|
color_map |
dict
|
Indicates what colors should be used for different ranges of the metric. The color_map's keys represent the lower bound of each range, which is a number, while the values represent the color for that range. |
None
|
width |
Union[str, number]
|
The width of the metric control, in CSS units. |
None
|
height |
Union[str, number]
|
The height of the metric control, in CSS units. |
None
|
layout |
dict[str, Any]
|
The plotly.js compatible layout object. |
None
|
template |
dict
|
The Plotly layout template. |
None
|
id |
str
|
The identifier that is assigned to the rendered HTML component. |
None
|
properties |
dict[str, Any]
|
Bound to a dictionary that contains additional properties for this element. |
None
|
class_name |
str
|
The list of CSS class names that are associated with the generated HTML Element. |
None
|
hover_text |
str
|
The information that is displayed when the user hovers over this element. |
None
|