Skip to content

PanelBuilderπŸ”—

ConstructorπŸ”—

new PanelBuilder()

MethodsπŸ”—

buildπŸ”—

Builds the object.

build()

axisBorderShowπŸ”—

axisBorderShow(bool $axisBorderShow)

axisCenteredZeroπŸ”—

axisCenteredZero(bool $axisCenteredZero)

axisColorModeπŸ”—

axisColorMode(\Grafana\Foundation\Common\AxisColorMode $axisColorMode)

axisGridShowπŸ”—

axisGridShow(bool $axisGridShow)

axisLabelπŸ”—

axisLabel(string $axisLabel)

axisPlacementπŸ”—

axisPlacement(\Grafana\Foundation\Common\AxisPlacement $axisPlacement)

axisSoftMaxπŸ”—

axisSoftMax(float $axisSoftMax)

axisSoftMinπŸ”—

axisSoftMin(float $axisSoftMin)

axisWidthπŸ”—

axisWidth(float $axisWidth)

barRadiusπŸ”—

Controls the radius of each bar.

barRadius(float $barRadius)

barWidthπŸ”—

Controls the width of bars. 1 = Max width, 0 = Min width.

barWidth(float $barWidth)

cacheTimeoutπŸ”—

Sets panel queries cache timeout.

cacheTimeout(string $cacheTimeout)

colorByFieldπŸ”—

Use the color value for a sibling field to color each bar value.

colorByField(string $colorByField)

colorSchemeπŸ”—

Panel color configuration

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\FieldColor> $color

colorScheme(\Grafana\Foundation\Cog\Builder $color)

datasourceπŸ”—

The datasource used in all targets.

datasource(\Grafana\Foundation\Dashboard\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.

decimals(float $decimals)

descriptionπŸ”—

Panel description.

description(string $description)

displayNameπŸ”—

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

displayName(string $displayName)

fillOpacityπŸ”—

Controls the fill opacity of the bars.

fillOpacity(int $fillOpacity)

fullHighlightπŸ”—

Enables mode which highlights the entire bar area and shows tooltip when cursor

hovers over highlighted area

fullHighlight(bool $fullHighlight)

gradientModeπŸ”—

Set the mode of the gradient fill. Fill gradient is based on the line color. To change the color, use the standard color scheme field option.

Gradient appearance is influenced by the Fill opacity setting.

gradientMode(\Grafana\Foundation\Common\GraphGradientMode $gradientMode)

gridPosπŸ”—

Grid position.

gridPos(\Grafana\Foundation\Dashboard\GridPos $gridPos)

groupWidthπŸ”—

Controls the width of groups. 1 = max with, 0 = min width.

groupWidth(float $groupWidth)

heightπŸ”—

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

height(int $h)

hideFromπŸ”—

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\HideSeriesConfig> $hideFrom

hideFrom(\Grafana\Foundation\Cog\Builder $hideFrom)

hideTimeOverrideπŸ”—

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

hideTimeOverride(bool $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.

id(int $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

interval(string $interval)

legendπŸ”—

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\VizLegendOptions> $legend

legend(\Grafana\Foundation\Cog\Builder $legend)

libraryPanelπŸ”—

Dynamically load the panel

libraryPanel(\Grafana\Foundation\Dashboard\LibraryPanelRef $libraryPanel)

lineWidthπŸ”—

Controls line width of the bars.

lineWidth(int $lineWidth)

Panel links.

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\DashboardLink>> $links

links(array $links)

mappingsπŸ”—

Convert input values into a display string

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\ValueMap>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\RangeMap>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\RegexMap>|\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\SpecialValueMap>> $mappings

mappings(array $mappings)

maxπŸ”—

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

max(float $max)

maxDataPointsπŸ”—

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

maxDataPoints(float $maxDataPoints)

maxPerRowπŸ”—

Option for repeated panels that controls max items per row

Only relevant for horizontally repeated panels

maxPerRow(float $maxPerRow)

minπŸ”—

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

min(float $min)

noValueπŸ”—

Alternative to empty string

noValue(string $noValue)

orientationπŸ”—

Controls the orientation of the bar chart, either vertical or horizontal.

orientation(\Grafana\Foundation\Common\VizOrientation $orientation)

overridesπŸ”—

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

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\DashboardFieldConfigSourceOverrides>> $overrides

overrides(array $overrides)

queryCachingTTLπŸ”—

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

queryCachingTTL(float $queryCachingTTL)

repeatπŸ”—

Name of template variable to repeat for.

repeat(string $repeat)

repeatDirectionπŸ”—

Direction to repeat in if 'repeat' is set.

h for horizontal, v for vertical.

repeatDirection(\Grafana\Foundation\Dashboard\PanelRepeatDirection $repeatDirection)

scaleDistributionπŸ”—

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\ScaleDistributionConfig> $scaleDistribution

scaleDistribution(\Grafana\Foundation\Cog\Builder $scaleDistribution)

showValueπŸ”—

This controls whether values are shown on top or to the left of bars.

showValue(\Grafana\Foundation\Common\VisibilityMode $showValue)

spanπŸ”—

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

span(int $w)

stackingπŸ”—

Controls whether bars are stacked or not, either normally or in percent mode.

stacking(\Grafana\Foundation\Common\StackingMode $stacking)

targetsπŸ”—

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

@param array<\Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Cog\Dataquery>> $targets

targets(array $targets)

textπŸ”—

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\VizTextDisplayOptions> $text

text(\Grafana\Foundation\Cog\Builder $text)

thresholdsπŸ”—

Map numeric values to states

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Dashboard\ThresholdsConfig> $thresholds

thresholds(\Grafana\Foundation\Cog\Builder $thresholds)

thresholdsStyleπŸ”—

Threshold rendering

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\GraphThresholdsStyleConfig> $thresholdsStyle

thresholdsStyle(\Grafana\Foundation\Cog\Builder $thresholdsStyle)

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

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

timeShift(string $timeShift)

titleπŸ”—

Panel title.

title(string $title)

tooltipπŸ”—

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Common\VizTooltipOptions> $tooltip

tooltip(\Grafana\Foundation\Cog\Builder $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.

@param array<\Grafana\Foundation\Dashboard\DataTransformerConfig> $transformations

transformations(array $transformations)

transparentπŸ”—

Whether to display the panel without a background.

transparent(bool $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.

unit(string $unit)

withOverrideπŸ”—

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

@param array<\Grafana\Foundation\Dashboard\DynamicConfigValue> $properties

withOverride(\Grafana\Foundation\Dashboard\MatcherConfig $matcher, array $properties)

withTargetπŸ”—

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

@param \Grafana\Foundation\Cog\Builder<\Grafana\Foundation\Cog\Dataquery> $target

withTarget(\Grafana\Foundation\Cog\Builder $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.

withTransformation(\Grafana\Foundation\Dashboard\DataTransformerConfig $transformation)

xFieldπŸ”—

Manually select which field from the dataset to represent the x field.

xField(string $xField)

xTickLabelMaxLengthπŸ”—

Sets the max length that a label can have before it is truncated.

xTickLabelMaxLength(int $xTickLabelMaxLength)

xTickLabelRotationπŸ”—

Controls the rotation of the x axis labels.

xTickLabelRotation(int $xTickLabelRotation)

xTickLabelSpacingπŸ”—

Controls the spacing between x axis labels.

negative values indicate backwards skipping behavior

xTickLabelSpacing(int $xTickLabelSpacing)

See alsoπŸ”—