@graphenedata/cli 0.0.3 → 0.0.5
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/cli.ts +7 -43
- package/dist/cli/cli.js +509 -277
- package/dist/docs/graphene.md +924 -63
- package/dist/ui/component-utilities/echarts.js +3 -1
- package/dist/ui/component-utilities/themeStores.ts +35 -7
- package/dist/ui/components/AreaChart.svelte +2 -1
- package/dist/ui/components/BarChart.svelte +2 -1
- package/dist/ui/components/BigValue.svelte +1 -1
- package/dist/ui/components/Chart.svelte +10 -1
- package/dist/ui/components/ECharts.svelte +2 -0
- package/dist/ui/components/LineChart.svelte +2 -1
- package/dist/ui/components/PieChart.svelte +1 -1
- package/dist/ui/components/QueryLoad.svelte +5 -6
- package/dist/ui/components/TableRow.svelte +1 -1
- package/dist/ui/components/_Table.svelte +2 -0
- package/dist/ui/internal/queryEngine.ts +16 -13
- package/dist/ui/internal/telemetry.ts +5 -3
- package/dist/ui/web.js +26 -11
- package/package.json +2 -1
- package/dist/docs/data_apps/components/charts/annotations.md +0 -673
- package/dist/docs/data_apps/components/charts/area-chart.md +0 -202
- package/dist/docs/data_apps/components/charts/bar-chart.md +0 -317
- package/dist/docs/data_apps/components/charts/box-plot.md +0 -190
- package/dist/docs/data_apps/components/charts/bubble-chart.md +0 -151
- package/dist/docs/data_apps/components/charts/calendar-heatmap.md +0 -112
- package/dist/docs/data_apps/components/charts/custom-echarts.md +0 -308
- package/dist/docs/data_apps/components/charts/echarts-options.md +0 -217
- package/dist/docs/data_apps/components/charts/funnel-chart.md +0 -106
- package/dist/docs/data_apps/components/charts/heatmap.md +0 -180
- package/dist/docs/data_apps/components/charts/histogram.md +0 -107
- package/dist/docs/data_apps/components/charts/line-chart.md +0 -265
- package/dist/docs/data_apps/components/charts/mixed-type-charts.md +0 -240
- package/dist/docs/data_apps/components/charts/sankey-diagram.md +0 -301
- package/dist/docs/data_apps/components/charts/scatter-plot.md +0 -134
- package/dist/docs/data_apps/components/charts/sparkline.md +0 -68
- package/dist/docs/data_apps/components/data/big-value.md +0 -153
- package/dist/docs/data_apps/components/data/delta.md +0 -89
- package/dist/docs/data_apps/components/data/table.md +0 -470
- package/dist/docs/data_apps/components/data/value.md +0 -97
- package/dist/docs/data_apps/components/inputs/button-group.md +0 -154
- package/dist/docs/data_apps/components/inputs/checkbox.md +0 -52
- package/dist/docs/data_apps/components/inputs/date-input.md +0 -131
- package/dist/docs/data_apps/components/inputs/date-range.md +0 -124
- package/dist/docs/data_apps/components/inputs/dimension-grid.md +0 -67
- package/dist/docs/data_apps/components/inputs/dropdown.md +0 -199
- package/dist/docs/data_apps/components/inputs/index.md +0 -3
- package/dist/docs/data_apps/components/inputs/slider.md +0 -126
- package/dist/docs/data_apps/components/inputs/text-input.md +0 -86
- package/dist/docs/data_apps/components/maps/area-map.md +0 -397
- package/dist/docs/data_apps/components/maps/base-map.md +0 -269
- package/dist/docs/data_apps/components/maps/bubble-map.md +0 -361
- package/dist/docs/data_apps/components/maps/point-map.md +0 -326
- package/dist/docs/data_apps/components/maps/us-map.md +0 -167
- package/dist/docs/data_apps/components/ui/accordion.md +0 -116
- package/dist/docs/data_apps/components/ui/alert.md +0 -37
- package/dist/docs/data_apps/components/ui/big-link.md +0 -19
- package/dist/docs/data_apps/components/ui/details.md +0 -58
- package/dist/docs/data_apps/components/ui/download-data.md +0 -41
- package/dist/docs/data_apps/components/ui/embed.md +0 -47
- package/dist/docs/data_apps/components/ui/grid.md +0 -45
- package/dist/docs/data_apps/components/ui/image.md +0 -61
- package/dist/docs/data_apps/components/ui/info.md +0 -47
- package/dist/docs/data_apps/components/ui/last-refreshed.md +0 -28
- package/dist/docs/data_apps/components/ui/link-button.md +0 -20
- package/dist/docs/data_apps/components/ui/link.md +0 -40
- package/dist/docs/data_apps/components/ui/modal.md +0 -57
- package/dist/docs/data_apps/components/ui/note.md +0 -32
- package/dist/docs/data_apps/components/ui/print-format-components.md +0 -85
- package/dist/docs/data_apps/components/ui/tabs.md +0 -122
|
@@ -1,202 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: 'Area Chart'
|
|
3
|
-
description: Track how a metric with multiple series changes over time, or a continuous range.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Use area charts to track how a metric with multiple series changes over time, or a continuous range. Area charts emphasize changes in the sum of series over the individual series.
|
|
7
|
-
|
|
8
|
-
**Example:**
|
|
9
|
-
|
|
10
|
-
```markdown
|
|
11
|
-
<AreaChart
|
|
12
|
-
data="orders_by_month"
|
|
13
|
-
x=month
|
|
14
|
-
y=sales
|
|
15
|
-
/>
|
|
16
|
-
```
|
|
17
|
-
|
|
18
|
-
## Examples
|
|
19
|
-
|
|
20
|
-
### Area
|
|
21
|
-
|
|
22
|
-
**Example:**
|
|
23
|
-
|
|
24
|
-
```markdown
|
|
25
|
-
<AreaChart
|
|
26
|
-
data="orders_by_month"
|
|
27
|
-
x=month
|
|
28
|
-
y=sales
|
|
29
|
-
/>
|
|
30
|
-
```
|
|
31
|
-
|
|
32
|
-
### Stacked
|
|
33
|
-
|
|
34
|
-
**Example:**
|
|
35
|
-
|
|
36
|
-
```markdown
|
|
37
|
-
<AreaChart
|
|
38
|
-
data="orders_by_category_2021"
|
|
39
|
-
x=month
|
|
40
|
-
y=sales
|
|
41
|
-
series=category
|
|
42
|
-
/>
|
|
43
|
-
```
|
|
44
|
-
|
|
45
|
-
### 100% Stacked
|
|
46
|
-
|
|
47
|
-
**Example:**
|
|
48
|
-
|
|
49
|
-
```markdown
|
|
50
|
-
<AreaChart
|
|
51
|
-
data="orders_by_category_2021"
|
|
52
|
-
x=month
|
|
53
|
-
y=sales
|
|
54
|
-
series=category
|
|
55
|
-
type=stacked100
|
|
56
|
-
/>
|
|
57
|
-
```
|
|
58
|
-
|
|
59
|
-
### Stepped Line
|
|
60
|
-
|
|
61
|
-
**Example:**
|
|
62
|
-
|
|
63
|
-
```markdown
|
|
64
|
-
<AreaChart
|
|
65
|
-
data="orders_by_category_2021"
|
|
66
|
-
x=month
|
|
67
|
-
y=sales
|
|
68
|
-
series=category
|
|
69
|
-
step=true
|
|
70
|
-
/>
|
|
71
|
-
```
|
|
72
|
-
|
|
73
|
-
### Y-Axis Formatting
|
|
74
|
-
|
|
75
|
-
**Example:**
|
|
76
|
-
|
|
77
|
-
```markdown
|
|
78
|
-
<AreaChart
|
|
79
|
-
data="orders_by_month"
|
|
80
|
-
x=month
|
|
81
|
-
y=sales
|
|
82
|
-
yFmt=usd0
|
|
83
|
-
/>
|
|
84
|
-
```
|
|
85
|
-
|
|
86
|
-
### Labels
|
|
87
|
-
|
|
88
|
-
**Example:**
|
|
89
|
-
|
|
90
|
-
```markdown
|
|
91
|
-
<AreaChart
|
|
92
|
-
data="orders_by_month"
|
|
93
|
-
x=month
|
|
94
|
-
y=sales
|
|
95
|
-
labels=true
|
|
96
|
-
labelFmt=usd0k
|
|
97
|
-
/>
|
|
98
|
-
```
|
|
99
|
-
|
|
100
|
-
## Options
|
|
101
|
-
|
|
102
|
-
### Data
|
|
103
|
-
|
|
104
|
-
| Property | Required | Type | Default | Description |
|
|
105
|
-
|----------|----------|------|---------|-------------|
|
|
106
|
-
| data | ✓ | query name | | Query name, wrapped in curly braces |
|
|
107
|
-
| x | ✓ | column name | First column | Column to use for the x-axis of the chart |
|
|
108
|
-
| y | ✓ | column name \| array of column names | Any non-assigned numeric columns | Column(s) to use for the y-axis of the chart |
|
|
109
|
-
| series | | column name | - | Column to use as the series (groups) in a multi-series chart |
|
|
110
|
-
| sort | | true/false | true | Whether to apply default sort to your data. Default sort is x ascending for number and date x-axes, and y descending for category x-axes |
|
|
111
|
-
| type | | stacked/stacked100 | stacked | Grouping method to use for multi-series charts |
|
|
112
|
-
| handleMissing | | gap/connect/zero | gap (single series) \| zero (multi-series) | Treatment of missing values in the dataset |
|
|
113
|
-
| emptySet | | error/warn/pass | error | 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. |
|
|
114
|
-
| emptyMessage | | string | "No records" | 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.). |
|
|
115
|
-
|
|
116
|
-
### Formatting & Styling
|
|
117
|
-
|
|
118
|
-
| Property | Type | Default | Description |
|
|
119
|
-
|----------|------|---------|-------------|
|
|
120
|
-
| xFmt | Excel-style format \| built-in format name \| custom format name | - | Format to use for x column ([see available formats](/core-concepts/formatting)) |
|
|
121
|
-
| yFmt | Excel-style format \| built-in format name \| custom format name | - | Format to use for y column ([see available formats](/core-concepts/formatting)) |
|
|
122
|
-
| seriesLabelFmt | Excel-style format \| built-in format name \| custom format name | - | Format to use for series label ([see available formats](/core-concepts/formatting)) |
|
|
123
|
-
| step | true/false | false | Specifies whether the chart is displayed as a step line. |
|
|
124
|
-
| stepPosition | start/middle/end | end | Configures the position of turn points for a step line chart. |
|
|
125
|
-
| fillColor | CSS name \| hexademical \| RGB \| HSL | - | Color to override default series color. Only accepts a single color. |
|
|
126
|
-
| lineColor | CSS name \| hexademical \| RGB \| HSL | - | Color to override default line color. Only accepts a single color. |
|
|
127
|
-
| fillOpacity | number (0 to 1) | 0.7 | % of the full color that should be rendered, with remainder being transparent |
|
|
128
|
-
| line | true/false | true | Show line on top of the area |
|
|
129
|
-
| colorPalette | array of color strings (CSS name \| hexademical \| RGB \| HSL) | built-in color palette | Array of custom colours to use for the chart E.g., ['#cf0d06','#eb5752','#e88a87'] Note that the array must be surrounded by curly braces. |
|
|
130
|
-
| seriesColors | object with series names and assigned colors | colors applied by order of series in data | 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 |
|
|
131
|
-
| seriesOrder | Array of series names in the order they should be used in the chart | default order implied by the data | Apply a specific order to the series in a multi-series chart. |
|
|
132
|
-
| leftPadding | number | | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off |
|
|
133
|
-
| rightPadding | number | | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off |
|
|
134
|
-
| xLabelWrap | true/false | false | Whether to wrap x-axis labels when there is not enough space. Default behaviour is to truncate the labels. |
|
|
135
|
-
|
|
136
|
-
### Value Labels
|
|
137
|
-
|
|
138
|
-
| Property | Type | Default | Description |
|
|
139
|
-
|----------|------|---------|-------------|
|
|
140
|
-
| labels | true/false | false | Show value labels |
|
|
141
|
-
| labelSize | number | 11 | Font size of value labels |
|
|
142
|
-
| labelPosition | above/middle/below | above | Where label will appear on your series |
|
|
143
|
-
| labelColor | CSS name \| hexademical \| RGB \| HSL | Automatic based on color contrast of background | Font color of value labels |
|
|
144
|
-
| labelFmt | Excel-style format \| built-in format name \| custom format name | same as y column | Format to use for value labels ([see available formats](/core-concepts/formatting)) |
|
|
145
|
-
| showAllLabels | true/false | false | Allow all labels to appear on chart, including overlapping labels |
|
|
146
|
-
|
|
147
|
-
### Axes
|
|
148
|
-
|
|
149
|
-
| Property | Type | Default | Description |
|
|
150
|
-
|----------|------|---------|-------------|
|
|
151
|
-
| yLog | true/false | false | Whether to use a log scale for the y-axis |
|
|
152
|
-
| yLogBase | number | 10 | Base to use when log scale is enabled |
|
|
153
|
-
| xAxisTitle | true/string/false | false | Name to show under x-axis. If 'true', formatted column name is used. Only works with swapXY=false |
|
|
154
|
-
| yAxisTitle | true/string/false | false | Name to show beside y-axis. If 'true', formatted column name is used. |
|
|
155
|
-
| xGridlines | true/false | false | Turns on/off gridlines extending from x-axis tick marks (vertical lines when swapXY=false) |
|
|
156
|
-
| yGridlines | true/false | true | Turns on/off gridlines extending from y-axis tick marks (horizontal lines when swapXY=false) |
|
|
157
|
-
| xAxisLabels | true/false | true | Turns on/off value labels on the x-axis |
|
|
158
|
-
| yAxisLabels | true/false | true | Turns on/off value labels on the y-axis |
|
|
159
|
-
| xBaseline | true/false | true | Turns on/off thick axis line (line appears at y=0) |
|
|
160
|
-
| yBaseline | true/false | false | Turns on/off thick axis line (line appears directly alongside the y-axis labels) |
|
|
161
|
-
| xTickMarks | true/false | false | Turns on/off tick marks for each of the x-axis labels |
|
|
162
|
-
| yTickMarks | true/false | false | Turns on/off tick marks for each of the y-axis labels |
|
|
163
|
-
| yMin | number | - | Starting value for the y-axis |
|
|
164
|
-
| yMax | number | - | Maximum value for the y-axis |
|
|
165
|
-
| yScale | true/false | false | Whether to scale the y-axis to fit your data. `yMin` and `yMax` take precedence over `yScale` |
|
|
166
|
-
|
|
167
|
-
### Chart
|
|
168
|
-
|
|
169
|
-
| Property | Type | Default | Description |
|
|
170
|
-
|----------|------|---------|-------------|
|
|
171
|
-
| title | string | - | Chart title. Appears at top left of chart. |
|
|
172
|
-
| subtitle | string | - | Chart subtitle. Appears just under title. |
|
|
173
|
-
| legend | true/false | true for multiple series | Turns legend on or off. Legend appears at top center of chart. |
|
|
174
|
-
| chartAreaHeight | number | 180 | 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. |
|
|
175
|
-
| renderer | canvas/svg | canvas | Which chart renderer type (canvas or SVG) to use. See ECharts' [documentation on renderers](https://echarts.apache.org/handbook/en/best-practices/canvas-vs-svg/). |
|
|
176
|
-
| downloadableData | true/false | true | Whether to show the download button to allow users to download the data |
|
|
177
|
-
| downloadableImage | true/false | true | Whether to show the button to allow users to save the chart as an image |
|
|
178
|
-
|
|
179
|
-
### Custom Echarts Options
|
|
180
|
-
|
|
181
|
-
| Property | Type | Default | Description |
|
|
182
|
-
|----------|------|---------|-------------|
|
|
183
|
-
| echartsOptions | `{{exampleOption:'exampleValue'}}` | - | Custom Echarts options to override the default options. See [reference page](/components/charts/echarts-options) for available options. |
|
|
184
|
-
| seriesOptions | `{{exampleSeriesOption:'exampleValue'}}` | - | 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 [reference page](/components/charts/echarts-options) for available options. |
|
|
185
|
-
| printEchartsConfig | true/false | false | 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 |
|
|
186
|
-
|
|
187
|
-
### Interactivity
|
|
188
|
-
|
|
189
|
-
| Property | Type | Description |
|
|
190
|
-
|----------|------|-------------|
|
|
191
|
-
| connectGroup | | Group name to connect this chart to other charts for synchronized tooltip hovering. Charts with the same `connectGroup` name will become connected |
|
|
192
|
-
|
|
193
|
-
## Annotations
|
|
194
|
-
|
|
195
|
-
Area charts can include [annotations](/components/charts/annotations) using the `ReferenceLine` and `ReferenceArea` components. These components are used within a chart component like so:
|
|
196
|
-
|
|
197
|
-
```html
|
|
198
|
-
<AreaChart data="sales_data" x=date y=sales>
|
|
199
|
-
<ReferenceLine data="target_data" y=target label=name />
|
|
200
|
-
<ReferenceArea xMin='2020-03-14' xMax='2020-05-01' />
|
|
201
|
-
</AreaChart>
|
|
202
|
-
```
|
|
@@ -1,317 +0,0 @@
|
|
|
1
|
-
---
|
|
2
|
-
title: Bar Chart
|
|
3
|
-
description: Compare a metric across a small number of categories.
|
|
4
|
-
---
|
|
5
|
-
|
|
6
|
-
Use bar or column charts to compare a metric across categories. Bar charts are best with a small number of categories and series, and should generally start at 0.
|
|
7
|
-
|
|
8
|
-
**Example:**
|
|
9
|
-
|
|
10
|
-
```markdown
|
|
11
|
-
<BarChart
|
|
12
|
-
data="orders_by_category_2021"
|
|
13
|
-
x=month
|
|
14
|
-
y=sales
|
|
15
|
-
series=category
|
|
16
|
-
title="Sales by Category"
|
|
17
|
-
/>
|
|
18
|
-
```
|
|
19
|
-
|
|
20
|
-
## Examples
|
|
21
|
-
|
|
22
|
-
### Default
|
|
23
|
-
|
|
24
|
-
**Example:**
|
|
25
|
-
|
|
26
|
-
```markdown
|
|
27
|
-
<BarChart
|
|
28
|
-
data="orders_by_month"
|
|
29
|
-
x=month
|
|
30
|
-
y=sales
|
|
31
|
-
/>
|
|
32
|
-
```
|
|
33
|
-
|
|
34
|
-
### Stacked
|
|
35
|
-
|
|
36
|
-
**Example:**
|
|
37
|
-
|
|
38
|
-
```markdown
|
|
39
|
-
<BarChart
|
|
40
|
-
data="orders_by_category_2021"
|
|
41
|
-
x=month
|
|
42
|
-
y=sales
|
|
43
|
-
series=category
|
|
44
|
-
/>
|
|
45
|
-
```
|
|
46
|
-
|
|
47
|
-
### 100% Stacked
|
|
48
|
-
|
|
49
|
-
**Example:**
|
|
50
|
-
|
|
51
|
-
```markdown
|
|
52
|
-
<BarChart
|
|
53
|
-
data="orders_by_category_2021"
|
|
54
|
-
x=month
|
|
55
|
-
y=sales
|
|
56
|
-
yFmt=pct0
|
|
57
|
-
series=category
|
|
58
|
-
type=stacked100
|
|
59
|
-
/>
|
|
60
|
-
```
|
|
61
|
-
|
|
62
|
-
### Grouped
|
|
63
|
-
|
|
64
|
-
**Example:**
|
|
65
|
-
|
|
66
|
-
```markdown
|
|
67
|
-
<BarChart
|
|
68
|
-
data="orders_by_category_2021"
|
|
69
|
-
x=month
|
|
70
|
-
y=sales
|
|
71
|
-
series=category
|
|
72
|
-
type=grouped
|
|
73
|
-
/>
|
|
74
|
-
```
|
|
75
|
-
|
|
76
|
-
### Horizontal
|
|
77
|
-
|
|
78
|
-
**Example:**
|
|
79
|
-
|
|
80
|
-
```markdown
|
|
81
|
-
<BarChart
|
|
82
|
-
data="orders_by_item_all_time"
|
|
83
|
-
x=item
|
|
84
|
-
y=sales
|
|
85
|
-
swapXY=true
|
|
86
|
-
yFmt=usd0k
|
|
87
|
-
/>
|
|
88
|
-
```
|
|
89
|
-
|
|
90
|
-
### Horizontal Stacked
|
|
91
|
-
|
|
92
|
-
**Example:**
|
|
93
|
-
|
|
94
|
-
```markdown
|
|
95
|
-
<BarChart
|
|
96
|
-
data="categories_by_channel"
|
|
97
|
-
x=category
|
|
98
|
-
y=sales
|
|
99
|
-
series=channel
|
|
100
|
-
swapXY=true
|
|
101
|
-
/>
|
|
102
|
-
```
|
|
103
|
-
|
|
104
|
-
### Horizontal 100% Stacked
|
|
105
|
-
|
|
106
|
-
**Example:**
|
|
107
|
-
|
|
108
|
-
```markdown
|
|
109
|
-
<BarChart
|
|
110
|
-
data="categories_by_channel"
|
|
111
|
-
x=category
|
|
112
|
-
y=sales
|
|
113
|
-
series=channel
|
|
114
|
-
type=stacked100
|
|
115
|
-
swapXY=true
|
|
116
|
-
/>
|
|
117
|
-
```
|
|
118
|
-
|
|
119
|
-
### Horizontal Grouped
|
|
120
|
-
|
|
121
|
-
**Example:**
|
|
122
|
-
|
|
123
|
-
```markdown
|
|
124
|
-
<BarChart
|
|
125
|
-
data="categories_by_channel"
|
|
126
|
-
x=category
|
|
127
|
-
y=sales
|
|
128
|
-
series=channel
|
|
129
|
-
type=grouped
|
|
130
|
-
swapXY=true
|
|
131
|
-
/>
|
|
132
|
-
```
|
|
133
|
-
|
|
134
|
-
### Value Labels
|
|
135
|
-
|
|
136
|
-
**Example:**
|
|
137
|
-
|
|
138
|
-
```markdown
|
|
139
|
-
<BarChart
|
|
140
|
-
data="orders_by_category_2021"
|
|
141
|
-
x=month
|
|
142
|
-
y=sales
|
|
143
|
-
yFmt=usd1k
|
|
144
|
-
series=category
|
|
145
|
-
labels=true
|
|
146
|
-
/>
|
|
147
|
-
```
|
|
148
|
-
|
|
149
|
-
### Custom Color Palette
|
|
150
|
-
|
|
151
|
-
**Example:**
|
|
152
|
-
|
|
153
|
-
```markdown
|
|
154
|
-
<BarChart
|
|
155
|
-
data="orders_by_category_2021"
|
|
156
|
-
x=month
|
|
157
|
-
y=sales
|
|
158
|
-
series=category
|
|
159
|
-
colorPalette={[
|
|
160
|
-
'#cf0d06',
|
|
161
|
-
'#eb5752',
|
|
162
|
-
'#e88a87',
|
|
163
|
-
'#fcdad9',
|
|
164
|
-
]}
|
|
165
|
-
/>
|
|
166
|
-
```
|
|
167
|
-
|
|
168
|
-
### Secondary / Dual y Axis
|
|
169
|
-
|
|
170
|
-
**Example:**
|
|
171
|
-
|
|
172
|
-
```markdown
|
|
173
|
-
<BarChart
|
|
174
|
-
data="orders_by_month"
|
|
175
|
-
x=month
|
|
176
|
-
y=sales
|
|
177
|
-
yFmt=usd0k
|
|
178
|
-
y2=num_orders
|
|
179
|
-
/>
|
|
180
|
-
```
|
|
181
|
-
|
|
182
|
-
### Secondary / Dual Axis with Line
|
|
183
|
-
|
|
184
|
-
**Example:**
|
|
185
|
-
|
|
186
|
-
```markdown
|
|
187
|
-
<BarChart
|
|
188
|
-
data="orders_by_month"
|
|
189
|
-
x=month
|
|
190
|
-
y=sales
|
|
191
|
-
yFmt=usd0k
|
|
192
|
-
y2=num_orders
|
|
193
|
-
y2SeriesType=line
|
|
194
|
-
/>
|
|
195
|
-
```
|
|
196
|
-
|
|
197
|
-
## Options
|
|
198
|
-
|
|
199
|
-
### Data
|
|
200
|
-
|
|
201
|
-
| Property | Description | Required | Options | Default |
|
|
202
|
-
|----------|-------------|----------|---------|---------|
|
|
203
|
-
| data | Query name, wrapped in curly braces | true | query name | - |
|
|
204
|
-
| x | Column to use for the x-axis of the chart | false | column name | First column |
|
|
205
|
-
| y | Column(s) to use for the y-axis of the chart | false | column name \| array of column names | Any non-assigned numeric columns |
|
|
206
|
-
| y2 | Column(s) to include on a secondary y-axis | false | column name \| array of column names | - |
|
|
207
|
-
| y2SeriesType | Chart type to apply to the series on the y2 axis | false | bar, line, scatter | bar |
|
|
208
|
-
| series | Column to use as the series (groups) in a multi-series chart | false | column name | - |
|
|
209
|
-
| sort | Whether to apply default sort to your data. Default sort is x ascending for number and date x-axes, and y descending for category x-axes | false | true, false | true |
|
|
210
|
-
| type | Grouping method to use for multi-series charts | false | stacked, grouped, stacked100 | stacked |
|
|
211
|
-
| stackName | Name for an individual stack. If separate Bar components are used with different stackNames, the chart will show multiple stacks | false | string | - |
|
|
212
|
-
| 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. | false | error, warn, pass | error |
|
|
213
|
-
| 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.). | false | string | No records |
|
|
214
|
-
|
|
215
|
-
### Formatting & Styling
|
|
216
|
-
|
|
217
|
-
| Property | Description | Options | Default |
|
|
218
|
-
|----------|-------------|---------|---------|
|
|
219
|
-
| xFmt | Format to use for x column (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
220
|
-
| yFmt | Format to use for y column (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
221
|
-
| y2Fmt | Format to use for y2 column(s) (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
222
|
-
| seriesLabelFmt | Format to use for series label (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
223
|
-
| fillColor | Color to override default series color. Only accepts a single color. | CSS name \| hexademical \| RGB \| HSL | - |
|
|
224
|
-
| fillOpacity | % of the full color that should be rendered, with remainder being transparent | number (0 to 1) | 1 |
|
|
225
|
-
| outlineWidth | Width of line surrounding each bar | number | 0 |
|
|
226
|
-
| outlineColor | Color to use for outline if outlineWidth > 0 | CSS name \| hexademical \| RGB \| HSL | - |
|
|
227
|
-
| colorPalette | Array of custom colours to use for the chart. E.g., `{['#cf0d06','#eb5752','#e88a87']}` | array of color strings (CSS name \| hexademical \| RGB \| HSL) | built-in color palette |
|
|
228
|
-
| 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 | object with series names and assigned colors seriesColors=`{{'Canada': 'red', 'US': 'blue'}}` | colors applied by order of series in data |
|
|
229
|
-
| seriesOrder | Apply a specific order to the series in a multi-series chart. | Array of series names in the order they should be used in the chart seriesOrder=`{['series one', 'series two']}` | default order implied by the data |
|
|
230
|
-
| leftPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | number | - |
|
|
231
|
-
| rightPadding | Number representing the padding (whitespace) on the left side of the chart. Useful to avoid labels getting cut off | number | - |
|
|
232
|
-
| xLabelWrap | Whether to wrap x-axis labels when there is not enough space. Default behaviour is to truncate the labels. | true, false | false |
|
|
233
|
-
|
|
234
|
-
### Value Labels
|
|
235
|
-
|
|
236
|
-
| Property | Description | Options | Default |
|
|
237
|
-
|----------|-------------|---------|---------|
|
|
238
|
-
| labels | Show value labels | true, false | false |
|
|
239
|
-
| stackTotalLabel | If using labels, whether to show a total at the top of stacked bar chart | true, false | true |
|
|
240
|
-
| seriesLabels | If using labels, whether to show series labels | true, false | true |
|
|
241
|
-
| labelSize | Font size of value labels | number | 11 |
|
|
242
|
-
| labelPosition | Where label will appear on your series | outside, inside | Single Series: outside, Stacked: inside, Grouped: outside |
|
|
243
|
-
| labelColor | Font color of value labels | CSS name \| hexademical \| RGB \| HSL | Automatic based on color contrast of background |
|
|
244
|
-
| labelFmt | Format to use for value labels (see available formats) | Excel-style format \| built-in format name \| custom format name | same as y column |
|
|
245
|
-
| yLabelFmt | Format to use for value labels for series on the y axis. Overrides any other formats (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
246
|
-
| y2LabelFmt | Format to use for value labels for series on the y2 axis. Overrides any other formats (see available formats) | Excel-style format \| built-in format name \| custom format name | - |
|
|
247
|
-
| showAllLabels | Allow all labels to appear on chart, including overlapping labels | true, false | false |
|
|
248
|
-
|
|
249
|
-
### Axes
|
|
250
|
-
|
|
251
|
-
| Property | Description | Options | Default |
|
|
252
|
-
|----------|-------------|---------|---------|
|
|
253
|
-
| swapXY | Swap the x and y axes to create a horizontal chart | true, false | false |
|
|
254
|
-
| yLog | Whether to use a log scale for the y-axis | true, false | false |
|
|
255
|
-
| yLogBase | Base to use when log scale is enabled | number | 10 |
|
|
256
|
-
| xAxisTitle | Name to show under x-axis. If 'true', formatted column name is used. Only works with swapXY=false | true, string, false | false |
|
|
257
|
-
| yAxisTitle | Name to show beside y-axis. If 'true', formatted column name is used. | true, string, false | false |
|
|
258
|
-
| y2AxisTitle | Name to show beside y2 axis. If 'true', formatted column name is used. | true, string, false | false |
|
|
259
|
-
| xGridlines | Turns on/off gridlines extending from x-axis tick marks (vertical lines when swapXY=false) | true, false | false |
|
|
260
|
-
| yGridlines | Turns on/off gridlines extending from y-axis tick marks (horizontal lines when swapXY=false) | true, false | true |
|
|
261
|
-
| y2Gridlines | Turns on/off gridlines extending from y2-axis tick marks (horizontal lines when swapXY=false) | true, false | true |
|
|
262
|
-
| xAxisLabels | Turns on/off value labels on the x-axis | true, false | true |
|
|
263
|
-
| yAxisLabels | Turns on/off value labels on the y-axis | true, false | true |
|
|
264
|
-
| y2AxisLabels | Turns on/off value labels on the y2-axis | true, false | true |
|
|
265
|
-
| xBaseline | Turns on/off thick axis line (line appears at y=0) | true, false | true |
|
|
266
|
-
| yBaseline | Turns on/off thick axis line (line appears directly alongside the y-axis labels) | true, false | false |
|
|
267
|
-
| y2Baseline | Turns on/off thick axis line (line appears directly alongside the y2-axis labels) | true, false | false |
|
|
268
|
-
| xTickMarks | Turns on/off tick marks for each of the x-axis labels | true, false | false |
|
|
269
|
-
| yTickMarks | Turns on/off tick marks for each of the y-axis labels | true, false | false |
|
|
270
|
-
| y2TickMarks | Turns on/off tick marks for each of the y2-axis labels | true, false | false |
|
|
271
|
-
| yMin | Starting value for the y-axis | number | - |
|
|
272
|
-
| yMax | Maximum value for the y-axis | number | - |
|
|
273
|
-
| yScale | Whether to scale the y-axis to fit your data. `yMin` and `yMax` take precedence over `yScale` | true, false | false |
|
|
274
|
-
| y2Min | Starting value for the y2-axis | number | - |
|
|
275
|
-
| y2Max | Maximum value for the y2-axis | number | - |
|
|
276
|
-
| y2Scale | Whether to scale the y-axis to fit your data. `y2Min` and `y2Max` take precedence over `y2Scale` | true, false | false |
|
|
277
|
-
| yAxisColor | Turns on/off color on the y-axis (turned on by default when secondary y-axis is used). Can also be used to set a specific color | true, false, color string (CSS name \| hexademical \| RGB \| HSL) | true when y2 used; false otherwise |
|
|
278
|
-
|
|
279
|
-
### Chart
|
|
280
|
-
|
|
281
|
-
| Property | Description | Options | Default |
|
|
282
|
-
|----------|-------------|---------|---------|
|
|
283
|
-
| title | Chart title. Appears at top left of chart. | string | - |
|
|
284
|
-
| subtitle | Chart subtitle. Appears just under title. | string | - |
|
|
285
|
-
| legend | Turns legend on or off. Legend appears at top center of chart. | true, false | true for multiple series |
|
|
286
|
-
| 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. | number | 180 |
|
|
287
|
-
| renderer | Which chart renderer type (canvas or SVG) to use. See ECharts' documentation on renderers. | canvas, svg | canvas |
|
|
288
|
-
| downloadableData | Whether to show the download button to allow users to download the data | true, false | true |
|
|
289
|
-
| downloadableImage | Whether to show the button to allow users to save the chart as an image | true, false | true |
|
|
290
|
-
|
|
291
|
-
### Custom Echarts Options
|
|
292
|
-
|
|
293
|
-
| Property | Description | Options |
|
|
294
|
-
|----------|-------------|---------|
|
|
295
|
-
| echartsOptions | Custom Echarts options to override the default options. See reference page for available options. | `{{exampleOption:'exampleValue'}}` |
|
|
296
|
-
| 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 reference page for available options. | `{{exampleSeriesOption:'exampleValue'}}` |
|
|
297
|
-
| 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 | true, false | false |
|
|
298
|
-
|
|
299
|
-
### Interactivity
|
|
300
|
-
|
|
301
|
-
| Property | Description | Options |
|
|
302
|
-
|----------|-------------|---------|
|
|
303
|
-
| connectGroup | Group name to connect this chart to other charts for synchronized tooltip hovering. Charts with the same `connectGroup` name will become connected | string |
|
|
304
|
-
|
|
305
|
-
## Annotations
|
|
306
|
-
|
|
307
|
-
|
|
308
|
-
Bar charts can include [annotations](/components/charts/annotations) using the `ReferenceLine` and `ReferenceArea` components. These components are used within a chart component like so:
|
|
309
|
-
|
|
310
|
-
**Example:**
|
|
311
|
-
|
|
312
|
-
```html
|
|
313
|
-
<BarChart data="orders_by_month" x=month y=sales>
|
|
314
|
-
<ReferenceArea xMin='2020-03-14' xMax='2021-05-01' label='COVID-19 Lockdown'/>
|
|
315
|
-
<ReferenceLine data="target_data" y=target label=name/>
|
|
316
|
-
</BarChart>
|
|
317
|
-
```
|