Bubble Chart

Loading...
<BubbleChart 
    data={price_vs_volume}
    x=price
    y=number_of_units
    xFmt=usd0
    series=category
    size=total_sales
/>

Examples

Default

Loading...
<BubbleChart 
    data={price_vs_volume}
    x=price
    y=number_of_units
    size=total_sales
/>

Multi-Series

Loading...
<BubbleChart 
    data={price_vs_volume}
    x=price
    y=number_of_units
    series=category
    size=total_sales
/>

Options

Data

data
Required
Query name, wrapped in curly braces
Options:
query name
x
Required
Column to use for the x-axis of the chart
Options:
column name
Default:
First column
y
Required
Column(s) to use for the y-axis of the chart
Options:
column name | array of column names
Default:
Any non-assigned numeric columns
series
Column to use as the series (groups) in a multi-series chart
Options:
column name
size
Required
Column to use to scale the size of the bubbles
Options:
column name
sort
Whether to apply default sort to your data. Default is x ascending for number and date x-axes, and y descending for category x-axes
Options:
Default:
true
tooltipTitle
Column to use as the title for each tooltip. Typically, this is a name to identify each point.
Options:
column name
emptySet
Sets behaviour for empty datasets. Can throw an error, a warning, or allow empty. When set to 'error', empty datasets will block builds in `build:strict`. Note this only applies to initial page load - empty datasets caused by input component changes (dropdowns, etc.) are allowed.
Default:
error
emptyMessage
Text to display when an empty dataset is received - only applies when `emptySet` is 'warn' or 'pass', or when the empty dataset is a result of an input component change (dropdowns, etc.).
Options:
string
Default:
No records

Formatting & Styling

xFmt
Format to use for x column (<a class=markdown href='/core-concepts/formatting'>see available formats<a/>)
Options:
Excel-style format | built-in format name | custom format name
yFmt
Format to use for y column (<a class=markdown href='/core-concepts/formatting'>see available formats<a/>)
Options:
Excel-style format | built-in format name | custom format name
sizeFmt
Format to use for size column (<a class=markdown href='/core-concepts/formatting'>see available formats<a/>)
Options:
Excel-style format | built-in format name | custom format name
shape
Options for which shape to use for bubble points
Options:
circle | emptyCircle | rect | triangle | diamond
Default:
circle
scaleTo
Scale the size of the bubbles by this factor (e.g., 2 will double the size)
Options:
number
Default:
1
opacity
% of the full color that should be rendered, with remainder being transparent
Options:
number (0 to 1)
Default:
0.7
fillColor
Color to override default series color. Only accepts a single color.
Options:
CSS name | hexademical | RGB | HSL
outlineWidth
Width of line surrounding each shape
Options:
number
Default:
0
outlineColor
Color to use for outline if outlineWidth > 0
Options:
CSS name | hexademical | RGB | HSL
colorPalette
Array of custom colours to use for the chart. E.g., ['#cf0d06','#eb5752','#e88a87'] Note that the array must be surrounded by curly braces.
Options:
array of color strings (CSS name | hexademical | RGB | HSL)
Default:
built-in color palette
seriesColors
Apply a specific color to each series in your chart. Unspecified series will receive colors from the built-in palette as normal. Note the double curly braces required in the syntax
Options:
object with series names and assigned colors
Default:
colors applied by order of series in data

Axes

yLog
Whether to use a log scale for the y-axis
Options:
Default:
false
yLogBase
Base to use when log scale is enabled
Options:
number
Default:
10
xAxisTitle
Name to show under x-axis. If 'true', formatted column name is used. Only works with swapXY=false
Options:
true | string | false
Default:
true
yAxisTitle
Name to show beside y-axis. If 'true', formatted column name is used.
Options:
true | string | false
Default:
true
xGridlines
Turns on/off gridlines extending from x-axis tick marks (vertical lines when swapXY=false)
Options:
Default:
false
yGridlines
Turns on/off gridlines extending from y-axis tick marks (horizontal lines when swapXY=false)
Options:
Default:
true
xAxisLabels
Turns on/off value labels on the x-axis
Options:
Default:
true
yAxisLabels
Turns on/off value labels on the y-axis
Options:
Default:
true
xBaseline
Turns on/off thick axis line (line appears at y=0)
Options:
Default:
true
yBaseline
Turns on/off thick axis line (line appears directly alongside the y-axis labels)
Options:
Default:
false
xTickMarks
Turns on/off tick marks for each of the x-axis labels
Options:
Default:
false
yTickMarks
Turns on/off tick marks for each of the y-axis labels
Options:
Default:
false
yMin
Starting value for the y-axis
Options:
number
yMax
Maximum value for the y-axis
Options:
number

Chart

title
Chart title. Appears at top left of chart.
Options:
string
subtitle
Chart subtitle. Appears just under title.
Options:
string
legend
Turns legend on or off. Legend appears at top center of chart.
Options:
Default:
true for multiple series
chartAreaHeight
Minimum height of the chart area (excl. header and footer) in pixels. Adjusting the height affects all viewport sizes and may impact the mobile UX.
Options:
number
Default:
180
renderer
Which chart renderer type (canvas or SVG) to use. See ECharts' <a href='https://echarts.apache.org/handbook/en/best-practices/canvas-vs-svg/' class=markdown>documentation on renderers</a>.
Options:
canvas | svg
Default:
canvas

Custom Echarts Options

echartsOptions
Custom Echarts options to override the default options. See <a href='/components/echarts-options/' class=markdown>reference page</a> for available options.
Options:
{{exampleOption:'exampleValue'}}
seriesOptions
Custom Echarts options to override the default options for all series in the chart. This loops through the series to apply the settings rather than having to specify every series manually using `echartsOptions` See <a href='/components/echarts-options/' class=markdown>reference page</a> for available options.
Options:
{{exampleSeriesOption:'exampleValue'}}
printEchartsConfig
Helper prop for custom chart development - inserts a code block with the current echarts config onto the page so you can see the options used and debug your custom options
Options:
Default:
false

Interactivity

connectGroup
Group name to connect this chart to other charts for synchronized tooltip hovering. Charts with the same `connectGroup` name will become connected

Annotations

Bubble charts can include annotations using the ReferenceLine and ReferenceArea components. These components are used within a chart component like so:

Loading...
<BubbleChart 
    data={price_vs_volume}
    x=price
    xFmt=usd0
    y=number_of_units
    size=total_sales
>
    <ReferenceLine
        x=75
        label="Consumer Limit"
    />
</BubbleChart>