Skip to content

Types Reference

This page documents the TypeScript types used by grafana-react components.

Source: types/panel-base.ts

PropertyTypeRequiredDescription
titlestringYesPanel title
descriptionstringNoPanel description
datasourcestringNoOverride datasource for this panel (defaults to dashboard datasource)
widthnumberNoPanel width in grid units (1-24)
heightnumberNoPanel height in grid units
xnumberNoX position (0-23)
ynumberNoY position
repeatstringNoVariable to repeat panel for
repeatDirection'v' | 'h'NoRepeat direction
childrenReactNodeNoPanel children (queries or query strings)

Override configuration for field-specific styling

Source: types/panel-base.ts

PropertyTypeRequiredDescription
refIdstringNoMatch by query refId
fieldNamestringNoMatch by exact field name
fieldRegexstringNoMatch by field name regex
colorstringNoFixed color
colorMode'shades' | 'fixed'NoColor mode (shades, fixed)
displayNamestringNoOverride display name
thresholdsThresholdSpecNoOverride thresholds

Table column override configuration

Source: types/panel-base.ts

PropertyTypeRequiredDescription
namestringYesColumn name to match
unitstringNoDisplay unit
widthnumberNoColumn width in pixels

Transformation configuration

Source: types/panel-base.ts

PropertyTypeRequiredDescription
idstringYesTransformation type ID
optionsRecord<string, unknown>YesTransformation options

Legend configuration

Source: types/display.ts

PropertyTypeRequiredDescription
placementLegendPlacementNo
displayModeLegendDisplayModeNo
calcsLegendCalc[]No
sortBystringNo
sortDescbooleanNo

Scale distribution configuration

Source: types/common/axis.ts

PropertyTypeRequiredDescription
typeScaleDistributionTypeYesScale type
lognumberNoLog base when type is ‘log’ (default: 2)
linearThresholdnumberNoLinear threshold for symlog scale

Axis configuration

Source: types/common/axis.ts

PropertyTypeRequiredDescription
axisPlacementAxisPlacementNoAxis placement relative to the graph
axisLabelstringNoAxis label text
axisWidthnumberNoAxis width in pixels
axisSoftMinnumberNoSoft minimum (can be exceeded by data)
axisSoftMaxnumberNoSoft maximum (can be exceeded by data)
axisColorModeAxisColorModeNoAxis color mode
axisGridShowbooleanNoShow axis grid lines
axisBorderShowbooleanNoShow axis border
axisCenteredZerobooleanNoCenter axis at zero
scaleDistributionScaleDistributionConfigNoScale distribution configuration

Tooltip configuration

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
modeTooltipDisplayModeYesTooltip display mode
sortSortOrderNoSort order for values in tooltip (defaults to ‘none’)
maxHeightnumberNoMaximum tooltip height in pixels
maxWidthnumberNoMaximum tooltip width in pixels

Data reduction options

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
calcs(LegendCalc | string)[]YesCalculations to perform (e.g., ‘mean’, ‘max’, ‘last’)
fieldsstringNoField name or regex to match
valuesbooleanNoReduce all values, not just series
limitnumberNoLimit number of values

Hide series configuration

Source: types/common/viz-options.ts

PropertyTypeRequiredDescription
legendbooleanYesHide from legend
tooltipbooleanYesHide from tooltip
vizbooleanYesHide from visualization

Single stat base options

Source: types/common/viz-options.ts

Extends TextFormattingOptions

PropertyTypeRequiredDescription
reduceOptionsReduceDataOptionsNoData reduction options
orientationVizOrientationNoOrientation of the visualization

Stacking configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
modeStackingModeYesStacking mode
groupstringNoStack group identifier

Line style configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
fillLineStyleFillNoLine fill style
dashnumber[]NoDash pattern array [dash, gap, dash, gap, …]

Graph thresholds style configuration

Source: types/common/field-config.ts

PropertyTypeRequiredDescription
modeThresholdStyleYesThreshold display mode

Graph field configuration

Source: types/common/field-config.ts

Extends AxisConfig

PropertyTypeRequiredDescription
drawStyle'line' | 'bars' | 'points'NoDraw style for the series
gradientModeGraphGradientModeNoGradient mode for fill
thresholdsStyleGraphThresholdsStyleConfigNoThreshold display style
lineColorstringNoLine color override
lineWidthnumberNoLine width in pixels
lineInterpolationLineInterpolationNoLine interpolation style
lineStyleLineStyleConfigNoLine style (solid, dash, dot)
fillColorstringNoFill color override
fillOpacitynumberNoFill opacity (0-100)
showPointsVisibilityModeNoShow points on lines
pointSizenumberNoPoint size in pixels
pointColorstringNoPoint color override
stackingStackingConfigNoStacking configuration
hideFromHideSeriesConfigNoHide series from legend/tooltip/viz
barAlignmentBarAlignmentNoBar alignment relative to time point
barMaxWidthnumberNoMaximum bar width in pixels
barWidthFactornumberNoBar width factor (0-1)
spanNullsboolean | numberNoConnect null values (true, false, or threshold in ms)
insertNullsboolean | numberNoInsert nulls when time gap exceeds threshold (true, false, or threshold in ms)
transform'constant' | 'negative-Y'NoTransform values