Skip to content

PanelπŸ”—

ConstructorπŸ”—

Panel()

MethodsπŸ”—

buildπŸ”—

Builds the object.

def build() -> dashboard.Panel

cache_timeoutπŸ”—

Sets panel queries cache timeout.

def cache_timeout(cache_timeout: str) -> typing.Self

color_schemeπŸ”—

Panel color configuration

def color_scheme(color: cogbuilder.Builder[dashboard.FieldColor]) -> typing.Self

The behavior when clicking on a result

def data_links(links: list[cogbuilder.Builder[dashboard.DashboardLink]]) -> typing.Self

datasourceπŸ”—

The datasource used in all targets.

def datasource(datasource: dashboard.DataSourceRef) -> typing.Self

decimalsπŸ”—

Specify the number of decimals Grafana includes in the rendered value.

If you leave this field blank, Grafana automatically truncates the number of decimals based on the value.

For example 1.1234 will display as 1.12 and 100.456 will display as 100.

To display all decimals, set the unit to String.

def decimals(decimals: float) -> typing.Self

descriptionπŸ”—

Panel description.

def description(description: str) -> typing.Self

display_nameπŸ”—

The display value for this field. This supports template variables blank is auto

def display_name(display_name: str) -> typing.Self

edgesπŸ”—

def edges(edges: cogbuilder.Builder[nodegraph.EdgeOptions]) -> typing.Self

grid_posπŸ”—

Grid position.

def grid_pos(grid_pos: dashboard.GridPos) -> typing.Self

heightπŸ”—

Panel height. The height is the number of rows from the top edge of the panel.

def height(h: int) -> typing.Self

hide_time_overrideπŸ”—

Controls if the timeFrom or timeShift overrides are shown in the panel header

def hide_time_override(hide_time_override: bool) -> typing.Self

id_valπŸ”—

Unique identifier of the panel. Generated by Grafana when creating a new panel. It must be unique within a dashboard, but not globally.

def id_val(id_val: int) -> typing.Self

intervalπŸ”—

The min time interval setting defines a lower limit for the $__interval and $__interval_ms variables.

This value must be formatted as a number followed by a valid time

identifier like: "40s", "3d", etc.

See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

def interval(interval: str) -> typing.Self

library_panelπŸ”—

Dynamically load the panel

def library_panel(library_panel: dashboard.LibraryPanelRef) -> typing.Self

Panel links.

def links(links: list[cogbuilder.Builder[dashboard.DashboardLink]]) -> typing.Self

mappingsπŸ”—

Convert input values into a display string

def mappings(mappings: list[dashboard.ValueMapping]) -> typing.Self

max_valπŸ”—

The maximum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.

def max_val(max_val: float) -> typing.Self

max_data_pointsπŸ”—

The maximum number of data points that the panel queries are retrieving.

def max_data_points(max_data_points: float) -> typing.Self

max_per_rowπŸ”—

Option for repeated panels that controls max items per row

Only relevant for horizontally repeated panels

def max_per_row(max_per_row: float) -> typing.Self

min_valπŸ”—

The minimum value used in percentage threshold calculations. Leave blank for auto calculation based on all series and fields.

def min_val(min_val: float) -> typing.Self

no_valueπŸ”—

Alternative to empty string

def no_value(no_value: str) -> typing.Self

nodesπŸ”—

def nodes(nodes: cogbuilder.Builder[nodegraph.NodeOptions]) -> typing.Self

overridesπŸ”—

Overrides are the options applied to specific fields overriding the defaults.

def overrides(overrides: list[cogbuilder.Builder[dashboard.DashboardFieldConfigSourceOverrides]]) -> typing.Self

query_caching_ttlπŸ”—

Overrides the data source configured time-to-live for a query cache item in milliseconds

def query_caching_ttl(query_caching_ttl: float) -> typing.Self

repeatπŸ”—

Name of template variable to repeat for.

def repeat(repeat: str) -> typing.Self

repeat_directionπŸ”—

Direction to repeat in if 'repeat' is set.

h for horizontal, v for vertical.

def repeat_direction(repeat_direction: typing.Literal["h", "v"]) -> typing.Self

spanπŸ”—

Panel width. The width is the number of columns from the left edge of the panel.

def span(w: int) -> typing.Self

targetsπŸ”—

Depends on the panel plugin. See the plugin documentation for details.

def targets(targets: list[cogbuilder.Builder[cogvariants.Dataquery]]) -> typing.Self

thresholdsπŸ”—

Map numeric values to states

def thresholds(thresholds: cogbuilder.Builder[dashboard.ThresholdsConfig]) -> typing.Self

time_fromπŸ”—

Overrides the relative time range for individual panels,

which causes them to be different than what is selected in

the dashboard time picker in the top-right corner of the dashboard. You can use this to show metrics from different

time periods or days on the same dashboard.

The value is formatted as time operation like: now-5m (Last 5 minutes), now/d (the day so far),

now-5d/d(Last 5 days), now/w (This week so far), now-2y/y (Last 2 years).

Note: Panel time overrides have no effect when the dashboard’s time range is absolute.

See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

def time_from(time_from: str) -> typing.Self

time_shiftπŸ”—

Overrides the time range for individual panels by shifting its start and end relative to the time picker.

For example, you can shift the time range for the panel to be two hours earlier than the dashboard time picker setting 2h.

Note: Panel time overrides have no effect when the dashboard’s time range is absolute.

See: https://grafana.com/docs/grafana/latest/panels-visualizations/query-transform-data/#query-options

def time_shift(time_shift: str) -> typing.Self

titleπŸ”—

Panel title.

def title(title: str) -> typing.Self

transformationsπŸ”—

List of transformations that are applied to the panel data before rendering.

When there are multiple transformations, Grafana applies them in the order they are listed.

Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.

def transformations(transformations: list[dashboard.DataTransformerConfig]) -> typing.Self

transparentπŸ”—

Whether to display the panel without a background.

def transparent(transparent: bool) -> typing.Self

unitπŸ”—

Unit a field should use. The unit you select is applied to all fields except time.

You can use the units ID availables in Grafana or a custom unit.

Available units in Grafana: https://github.com/grafana/grafana/blob/main/packages/grafana-data/src/valueFormats/categories.ts

As custom unit, you can use the following formats:

suffix:<suffix> for custom unit that should go after value.

prefix:<prefix> for custom unit that should go before value.

time:<format> For custom date time formats type for example time:YYYY-MM-DD.

si:<base scale><unit characters> for custom SI units. For example: si: mF. This one is a bit more advanced as you can specify both a unit and the source data scale. So if your source data is represented as milli (thousands of) something prefix the unit with that SI scale character.

count:<unit> for a custom count unit.

currency:<unit> for custom a currency unit.

def unit(unit: str) -> typing.Self

with_overrideπŸ”—

Overrides are the options applied to specific fields overriding the defaults.

def with_override(matcher: dashboard.MatcherConfig, properties: list[dashboard.DynamicConfigValue]) -> typing.Self

with_targetπŸ”—

Depends on the panel plugin. See the plugin documentation for details.

def with_target(target: cogbuilder.Builder[cogvariants.Dataquery]) -> typing.Self

with_transformationπŸ”—

List of transformations that are applied to the panel data before rendering.

When there are multiple transformations, Grafana applies them in the order they are listed.

Each transformation creates a result set that then passes on to the next transformation in the processing pipeline.

def with_transformation(transformation: dashboard.DataTransformerConfig) -> typing.Self

zoom_modeπŸ”—

How to handle zoom/scroll events in the node graph

def zoom_mode(zoom_mode: nodegraph.ZoomMode) -> typing.Self

See alsoπŸ”—