Skip to main content

The Sunburst Chart component for Retool Apps

A content area to display sunburst charts.

The Sunburst Chart component renders hierarchical data in a series of concentric rings. Sunburst Chart is useful for visualizing parent-child relationships and how parts make up a whole.

Properties

All properties for this object with supported data types or values. You can write JavaScript almost anywhere in Retool to manipulate or read property values.

chartType

The type of chart to display.

Type string
Format Plain Text
Configurability Inspector > Content > Series > Chart type
Allowed Values
ValueUI OptionDescription
barBar

Bar Chart or Stacked Bar Chart.

bubbleBubble

Bubble Chart.

funnelFunnel

Funnel Chart.

heatmapHeatmap

Heat Map.

lineLine

Line Chart or Sparkline.

mixedMixed

Mixed Chart.

piePie

Pie Chart.

plotlyJsonPlotly JSON

Plotly JSON Chart.

sankeySankey

Sankey Chart.

scatterScatter

Scatter Chart.

sunburstSunburst

Sunburst Chart.

treemapTreemap

Treemap.

waterfallWaterfall

Waterfall Chart.

Defaultnull
Examples
"bar"

clearOnEmptyData

Whether to clear the chart when the data is empty.

Type boolean
Format True/False
Configurability Inspector > Content > Clear when data is empty
Defaultfalse
Examples
true

colorArray

A list of colors to use when colorInputMode is colorArray.

Type array
Format Color
Array values string
Configurability Inspector
Defaultnull
Examples
["#ff0000", "#00ff00", "#0000ff"]

colorArrayDropDown

A list of colors to use when colorInputMode is colorArrayDropDown.

Type array
Format Color
Array values string
Configurability Inspector > Appearance > Color selection
Defaultnull
Examples
["#ff0000", "#00ff00", "#0000ff"]

colorInputMode

The mode for the color input.

Type string
Format Plain Text
Configurability Inspector > Appearance > Color selection
Allowed Values
ValueUI OptionDescription
colorArrayArray

Color array.

gradientColorArrayPalette

Gradient color array.

colorArrayDropDownManual

Color array dropdown.

DefaultcolorArray
Examples
"colorArray"

datasource

The source data when using UI Form.

Type array
Array values object
Configurability Inspector
Defaultnull

datasourceMode

The data source mode.

Type string
Configurability Read-only
Allowed Values
ValueDescription
manual

Manual.

source

Source.

Defaultnull

events

A list of configured event handlers that trigger actions or queries.

Type array
Array values object
Configurability Inspector > Interaction > Event handlers
Defaultnull
Array Object Properties

event

The event that triggers the action. Refer to the events section for details of available events for this object.

Type string
Configurability Inspector > Interaction > Event handlers > Event
Defaultnull

method

The JavaScript method to perform when type is datasource, widget, state, or localStorage.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Run script actions
Defaultnull

type

The type of action to perform.

Type string
Configurability Inspector > Interaction > Event handlers > Edit event handler > Action
Allowed Values
ValueDescription
datasource

Control query.

widget

Control component.

script

Run script.

state

Set variable.

localStorage

Set localStorage.

util

Perform utility action (e.g., Open URL or Confetti).

Defaultnull


gradientColorArray

A list of colors to use when colorInputMode is gradientColorArray.

Type array
Format Color
Array values string
Configurability Inspector > Appearance > Color selection
Defaultnull

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Configurability Inspector > Appearance > Hidden
Defaultfalse
Examples
true

hoverTemplate

The tooltip template for displaying information when you hover over a point.

Type string
Format Plain Text
Configurability Inspector > Content > Add-ons > Tooltip
Default%{value}<br>%{percent}<extra></extra>
Examples
%{value}<br>%{percent}<extra></extra>

hoverTemplateMode

Whether the hover tooltip text maps from available options or is manually specified.

Type string
Format Plain Text
Configurability Inspector > Content > Add-ons > Tooltip
Allowed Values
ValueDescription
source

Source mode.

manual

Manual mode.

Defaultnull

id

The unique identifier (name).

Type string
Format Plain Text
Configurability Inspector
DefaultsunburstChart1
Examples
query1
button1

isHiddenOnDesktop

Whether to show or hide this object in the desktop layout.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Show on desktop
Defaultfalse
Examples
true

isHiddenOnMobile

Whether to show or hide this object in the mobile layout.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Show on mobile
Defaulttrue
Examples
true

labelData

A list of labels for each node.

Type array
Array values string
Configurability Inspector > Content > Labels
Default[]
Examples
["Node 1", "Node 2", "Node 3"]

labelDataMode

Whether labels map from a selected option or are manually specified.

Type string
Format Plain Text
Configurability Inspector > Content > Labels
Allowed Values
ValueDescription
source

Source mode.

manual

Manual mode.

Defaultnull

legendPosition

The position of the legend.

Type string
Configurability Inspector > Content > Add-ons > Legend position
Allowed Values
ValueUI OptionDescription
topAlign top

Top.

rightAlign right

Right.

bottomAlign bottom

Bottom.

leftAlign left

Left.

noneNo legend

None.

Defaultnull

lineWidth

The width of the line.

Type number
Configurability Read-only
Defaultnull

maintainSpaceWhenHidden

Whether to take up space on the canvas if hidden is true.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Maintain space when hidden
Defaultfalse
Examples
true

margin

The amount of margin to render outside.

Type string
Format Plain Text
Configurability Inspector > Spacing > Margin
Allowed Values
ValueUI OptionDescription
4px 8pxNormal

Normal margin.

0None

No margin.

Default4px 8px
Examples
4px 8px

paperBgColor

The paper background color.

Type string
Configurability Read-only
Defaultnull

parentData

The parent to which a given node is associated.

Type array
Array values string
Configurability Inspector
Defaultnull

parentDataMode

(No description available)

Type unknown
Configurability Read-only
Defaultnull

plotBgColor

The plot background color.

Type string
Configurability Read-only
Defaultnull

selectedPoints

A list of selected points.

Type array
Configurability Read-only
Defaultnull

showInEditor

Whether the component remains visible in the editor if hidden is true.

Type boolean
Format True/False
Configurability Inspector > Appearance > Advanced > Always show in edit mode
Defaultfalse
Examples
true

sunburstDataBranchValues

The branch values for the Sunburst Chart.

Type string
Configurability Inspector
Allowed Values
ValueDescription
remainder

The remainder branch values.

total

The total of the branch values.

Defaultnull

sunburstDataLeafOpacity

The opacity of the leaf nodes in the Sunburst Chart.

Type number
Configurability Inspector
Defaultnull

textTemplate

The format to use for data labels, constructed in Plotly template format.

Type string
Configurability Inspector > Content > Add-ons > Data labels > Data label
Defaultnull

textTemplateMode

Whether the text template is in manual mode.

Type string
Format Plain Text
Configurability Read-only
Allowed Values
ValueDescription
source

Source mode.

manual

Manual mode.

Defaultnull

textTemplatePosition

The orientation of the data labels.

Type string
Configurability Inspector > Content > Add-ons > Data labels > Orientation
Allowed Values
ValueDescription
radial

Radial orientation.

horizontal

Horizontal orientation.

vertical

Vertical orientation.

Defaultnull

toolbar

The toolbar configuration.

Type object
Configurability Inspector > Content > Add-ons > Toolbar
Defaultnull
Object Properties

showAutoscale

Whether to show the Autoscale button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showBoxSelect

Whether to show the Box select button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showLassoSelect

Whether to show the Lasso select button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showPan

Whether to show the Pan button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showResetViews

Whether to show the Reset view button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showToImage

Whether to show the Download as PNG button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showZoomIn

Whether to show the Zoom in button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showZoomOut

Whether to show the Zoom out button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true

showZoomSelect

Whether to show the Zoom select button.

Type boolean
Format True/False
Configurability Inspector
Defaultnull
Examples
true


valueData

The value for a specific node.

Type array
Array values number
Configurability Inspector
Defaultnull

valueDataMode

Whether values map from a selected option or are manually specified.

Type string
Format Plain Text
Configurability Inspector > Content > Values
Allowed Values
ValueDescription
source

Source mode.

manual

Manual mode.

Defaultnull

Methods

JavaScript API methods for this object. You can write JavaScript almost anywhere in Retool and use methods to manipulate data and property values.

sunburstChart.scrollIntoView()

Scrolls the canvas or parent container so that the selected component appears in the visible area.

Definition
sunburstChart.scrollIntoView(options)
Parameters

options

The scroll options.

Type object
Object Properties

behavior

The scroll behavior.

Type string
Allowed Values
ValueDescription
auto

Scroll immediately to the specified position.

smooth

Scroll gradually to the specified position.


block

The scroll position relative to the component.

Type string
Allowed Values
ValueDescription
nearest

Scrolls only the minimum amount required for the component to appear in the visible area. Scrolling does not occur if the component is already in view.

start

Scrolls to position the component at the top of the visible area.

center

Scrolls to position the component in the middle of the visible area.

end

Scrolls to position the component at the bottom of the visible area.



Examples

Scroll the minimum amount to immediately bring sunburstChart into view.

sunburstChart.scrollIntoView({behavior: 'auto', block: 'nearest'});

sunburstChart.setHidden()

Set the hidden value to toggle whether the component is visible. Defaults to true without a parameter.

Definition
sunburstChart.setHidden(hidden)
Parameters

hidden

Whether this object is hidden from view.

Type boolean
Format True/False
Default
false
Examples
true

Examples

Hide sunburstChart.

sunburstChart.setHidden(true);

Unhide sunburstChart.

sunburstChart.setHidden(false);

Events

Events triggered by user interactions. You can configure event handlers in the IDE to trigger queries or other actions in response to events.

EventDescription
ClearA value is cleared.
HoverAn item is hovered over.
Legend ClickA legend item is clicked or pressed.
Legend Double ClickA legend item is double-clicked or pressed.
SelectA value is selected.
UnhoverAn item is no longer hovered over.