Skip to main content
POST
Create a chart

Authorizations

Authorization
string
header
required

API key authentication using Bearer token format: Bearer <basedash_api_key>

Path Parameters

orgId
string
required

Organization ID

Body

application/json
dashboardId
string
required

ID of the dashboard to place the chart on

Minimum string length: 1
dashboardTabId
string

ID of the dashboard tab to place the chart on. Defaults to the first tab.

layout
object

Position and size of the chart on the dashboard grid. Defaults to the bottom of the tab.

name
string

Name of the chart

Required string length: 1 - 500
description
string | null

Description of the chart

chartType

Type of the chart

Available options:
TABLE
sqlQuery
string

SQL query powering the chart

drilldownSqlQuery
string | null

SQL query used for chart drill-downs

databaseConnectionId
string | null

ID of the data source the SQL query runs against

xAxisProperty
string | null

Result column used for the x-axis

xAxisSecondaryProperty
string | null

Result column used to break down the x-axis into segments

yAxisProperty
string | null

Result column used for the y-axis

staticContent
string | null

Static content for DASHBOARD_HEADER and DASHBOARD_TEXT chart types

numericalFormat

How values are formatted. PERCENTAGE expects values on a 0-100 scale (42.5 shows as 42.5%); it does not convert 0-1 ratios.

Available options:
NUMBER
currencyCode
string | null

ISO 4217 currency code (for example USD or EUR) used when numericalFormat is CURRENCY. Null uses USD.

showFullNumbers
boolean

Show full numbers (1,234,567) instead of abbreviated ones (1.2M).

metricLabel
string | null

NUMBER charts: label shown with the value. Null uses the chart name.

timeSeriesMetricType

Summary value shown above LINE and VERTICAL_BAR charts: the SUM, AVERAGE or LATEST value of the series, or NONE to hide it. With a breakdown, NONE plus showLegend true shows segment labels only. PIE, FUNNEL and HORIZONTAL_BAR charts show the total unless this is NONE.

Available options:
SUM
tableMetricType

TABLE charts: COUNT shows the record count above the table, NONE hides it.

Available options:
NONE
showLegend
boolean

Show the series legend (LINE, VERTICAL_BAR, HORIZONTAL_BAR, PIE, FUNNEL and SCATTER charts).

goalLineValue
number | null

Value of the target (goal) line on LINE, VERTICAL_BAR and SCATTER charts. Null hides it.

yAxisMinimum
number | null

Lower bound of the y-axis. Null picks it from the data.

yAxisMaximum
number | null

Upper bound of the y-axis. Null picks it from the data.

xAxisMinimum
number | null

SCATTER charts: lower bound of the x-axis. Null picks it from the data.

xAxisMaximum
number | null

SCATTER charts: upper bound of the x-axis. Null picks it from the data.

barMode

How bars of a VERTICAL_BAR or HORIZONTAL_BAR chart with a breakdown (xAxisSecondaryProperty) combine: STACKED or side by side (GROUPED).

Available options:
STACKED
colorByCategory
boolean

Give each bar its own color by category on a single-series HORIZONTAL_BAR, categorical VERTICAL_BAR or FUNNEL chart. segmentColors are then keyed by category (xAxisProperty) value. Ignored while the chart has a breakdown.

seriesColor
enum<string> | null

Color of the series on a chart without a breakdown (LINE, VERTICAL_BAR, HORIZONTAL_BAR, FUNNEL, SCATTER). Null picks it automatically.

Available options:
NEUTRAL,
BLUE,
ORANGE,
PURPLE,
RED,
TEAL,
GREEN,
YELLOW,
PINK
segmentColors
object | null

Colors of segments, keyed by segment value: breakdown values on LINE, VERTICAL_BAR, HORIZONTAL_BAR, FUNNEL and SCATTER charts, slices on PIE charts, nodes on SANKEY charts, or categories with colorByCategory. Segments left out are colored automatically. Merged by key: null for a segment resets it to automatic; null for the whole field resets every segment.

imageProperty
string | null

IMAGE charts: result column holding the image URL.

imageFit

IMAGE charts: whether the image covers the card or fits inside it.

Available options:
CONTAIN
imageGrowToFit
boolean

IMAGE charts: grow the image to fill the card.

textProperty
string | null

TEXT charts: result column holding the text to show.

mapVariant

MAP charts: WORLD (matches country names) or UNITED_STATES (matches state names).

Available options:
WORLD
tableColumns
object | null

TABLE charts: column widths and pins, keyed by result column name. Columns left out use the defaults. Merged by column: a column given replaces that column's settings, null resets it; null for the whole field resets every column.

Response

Chart created successfully

data
object
required