Skip to content

PanelBuilderπŸ”—

ConstructorπŸ”—

new PanelBuilder()

MethodsπŸ”—

buildπŸ”—

Builds the object.

public Panel build()

cacheTimeoutπŸ”—

Sets panel queries cache timeout.

public PanelBuilder cacheTimeout(String cacheTimeout)

colorSchemeπŸ”—

Panel color configuration

public PanelBuilder colorScheme(com.grafana.foundation.cog.Builder<FieldColor> color)

The behavior when clicking on a result

public PanelBuilder dataLinks(List<com.grafana.foundation.cog.Builder<DashboardLink>> links)

datasourceπŸ”—

The datasource used in all targets.

public PanelBuilder datasource(DataSourceRef datasource)

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.

public PanelBuilder decimals(Double decimals)

descriptionπŸ”—

Panel description.

public PanelBuilder description(String description)

displayLabelsπŸ”—

public PanelBuilder displayLabels(List<PieChartLabels> displayLabels)

displayNameπŸ”—

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

public PanelBuilder displayName(String displayName)

gridPosπŸ”—

Grid position.

public PanelBuilder gridPos(GridPos gridPos)

heightπŸ”—

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

public PanelBuilder height(Integer h)

hideFromπŸ”—

public PanelBuilder hideFrom(com.grafana.foundation.cog.Builder<HideSeriesConfig> hideFrom)

hideTimeOverrideπŸ”—

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

public PanelBuilder hideTimeOverride(Boolean hideTimeOverride)

idπŸ”—

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

public PanelBuilder id(Integer id)

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

public PanelBuilder interval(String interval)

legendπŸ”—

public PanelBuilder legend(com.grafana.foundation.cog.Builder<PieChartLegendOptions> legend)

libraryPanelπŸ”—

Dynamically load the panel

public PanelBuilder libraryPanel(LibraryPanelRef libraryPanel)

Panel links.

public PanelBuilder links(List<com.grafana.foundation.cog.Builder<DashboardLink>> links)

mappingsπŸ”—

Convert input values into a display string

public PanelBuilder mappings(List<ValueMapping> mappings)

maxπŸ”—

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

public PanelBuilder max(Double max)

maxDataPointsπŸ”—

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

public PanelBuilder maxDataPoints(Double maxDataPoints)

maxPerRowπŸ”—

Option for repeated panels that controls max items per row

Only relevant for horizontally repeated panels

public PanelBuilder maxPerRow(Double maxPerRow)

minπŸ”—

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

public PanelBuilder min(Double min)

noValueπŸ”—

Alternative to empty string

public PanelBuilder noValue(String noValue)

orientationπŸ”—

public PanelBuilder orientation(VizOrientation orientation)

overrideByFieldTypeπŸ”—

Adds override rules for all the fields of the given type.

public PanelBuilder overrideByFieldType(String fieldType, List<DynamicConfigValue> properties)

overrideByNameπŸ”—

Adds override rules for a specific field, referred to by its name.

public PanelBuilder overrideByName(String name, List<DynamicConfigValue> properties)

overrideByQueryπŸ”—

public PanelBuilder overrideByQuery(String queryRefId, List<DynamicConfigValue> properties)

overrideByRegexpπŸ”—

Adds override rules for the fields whose name match the given regexp.

public PanelBuilder overrideByRegexp(String regexp, List<DynamicConfigValue> properties)

overridesπŸ”—

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

public PanelBuilder overrides(List<com.grafana.foundation.cog.Builder<DashboardFieldConfigSourceOverrides>> overrides)

pieTypeπŸ”—

public PanelBuilder pieType(PieChartType pieType)

queryCachingTTLπŸ”—

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

public PanelBuilder queryCachingTTL(Double queryCachingTTL)

reduceOptionsπŸ”—

public PanelBuilder reduceOptions(com.grafana.foundation.cog.Builder<ReduceDataOptions> reduceOptions)

repeatπŸ”—

Name of template variable to repeat for.

public PanelBuilder repeat(String repeat)

repeatDirectionπŸ”—

Direction to repeat in if 'repeat' is set.

h for horizontal, v for vertical.

public PanelBuilder repeatDirection(PanelRepeatDirection repeatDirection)

spanπŸ”—

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

public PanelBuilder span(Integer w)

targetsπŸ”—

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

public PanelBuilder targets(List<com.grafana.foundation.cog.Builder<Dataquery>> targets)

textπŸ”—

public PanelBuilder text(com.grafana.foundation.cog.Builder<VizTextDisplayOptions> text)

thresholdsπŸ”—

Map numeric values to states

public PanelBuilder thresholds(com.grafana.foundation.cog.Builder<ThresholdsConfig> thresholds)

timeFromπŸ”—

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

public PanelBuilder timeFrom(String timeFrom)

timeShiftπŸ”—

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

public PanelBuilder timeShift(String timeShift)

titleπŸ”—

Panel title.

public PanelBuilder title(String title)

tooltipπŸ”—

public PanelBuilder tooltip(com.grafana.foundation.cog.Builder<VizTooltipOptions> tooltip)

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.

public PanelBuilder transformations(List<DataTransformerConfig> transformations)

transparentπŸ”—

Whether to display the panel without a background.

public PanelBuilder transparent(Boolean transparent)

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.

public PanelBuilder unit(String unit)

withOverrideπŸ”—

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

public PanelBuilder withOverride(com.grafana.foundation.cog.Builder<DashboardFieldConfigSourceOverrides> override)

withTargetπŸ”—

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

public PanelBuilder withTarget(com.grafana.foundation.cog.Builder<Dataquery> target)

withTransformationπŸ”—

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.

public PanelBuilder withTransformation(DataTransformerConfig transformation)

See alsoπŸ”—