mirror of
https://github.com/apache/superset.git
synced 2026-07-04 05:45:32 +00:00
Compare commits
3 Commits
chore/ci/s
...
yousoph-ec
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
9a05c06b3a | ||
|
|
a17b0840ef | ||
|
|
dbe8a877a2 |
@@ -228,32 +228,31 @@ Apply settings to all ECharts visualizations using `echartsOptionsOverrides`:
|
|||||||
|
|
||||||
```python
|
```python
|
||||||
THEME_DEFAULT = {
|
THEME_DEFAULT = {
|
||||||
"token": {
|
"token": {
|
||||||
"colorPrimary": "#2893B3",
|
"colorPrimary": "#2893B3",
|
||||||
# ... other Ant Design tokens
|
# ... other Ant Design tokens
|
||||||
},
|
|
||||||
"echartsOptionsOverrides": {
|
"echartsOptionsOverrides": {
|
||||||
"grid": {
|
"grid": {
|
||||||
"left": "10%",
|
"left": "10%",
|
||||||
"right": "10%",
|
"right": "10%",
|
||||||
"top": "15%",
|
"top": "15%",
|
||||||
"bottom": "15%"
|
"bottom": "15%"
|
||||||
},
|
},
|
||||||
"tooltip": {
|
"tooltip": {
|
||||||
"backgroundColor": "rgba(0, 0, 0, 0.8)",
|
"backgroundColor": "rgba(0, 0, 0, 0.8)",
|
||||||
"borderColor": "#ccc",
|
"borderColor": "#ccc",
|
||||||
"textStyle": {
|
"textStyle": {
|
||||||
"color": "#fff"
|
"color": "#fff"
|
||||||
}
|
|
||||||
},
|
|
||||||
"legend": {
|
|
||||||
"textStyle": {
|
|
||||||
"fontSize": 14,
|
|
||||||
"fontWeight": "bold"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"legend": {
|
||||||
|
"textStyle": {
|
||||||
|
"fontSize": 14,
|
||||||
|
"fontWeight": "bold"
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
```
|
```
|
||||||
|
|
||||||
### Chart-Specific Overrides
|
### Chart-Specific Overrides
|
||||||
@@ -264,38 +263,45 @@ Target specific chart types using `echartsOptionsOverridesByChartType`:
|
|||||||
THEME_DEFAULT = {
|
THEME_DEFAULT = {
|
||||||
"token": {
|
"token": {
|
||||||
"colorPrimary": "#2893B3",
|
"colorPrimary": "#2893B3",
|
||||||
# ... other tokens
|
"echartsOptionsOverridesByChartType": {
|
||||||
},
|
"pie": {
|
||||||
"echartsOptionsOverridesByChartType": {
|
"tooltip": {
|
||||||
"echarts_pie": {
|
"backgroundColor": "rgba(0, 0, 0, 0.8)",
|
||||||
"legend": {
|
"borderColor": "#ccc",
|
||||||
"orient": "vertical",
|
"textStyle": {
|
||||||
"right": 10,
|
"color": "#fff"
|
||||||
"top": "center"
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
"echarts_timeseries": {
|
|
||||||
"xAxis": {
|
|
||||||
"axisLabel": {
|
|
||||||
"rotate": 45,
|
|
||||||
"fontSize": 12
|
|
||||||
}
|
|
||||||
},
|
},
|
||||||
"dataZoom": [{
|
"legend": {
|
||||||
|
"orient": "vertical",
|
||||||
|
"right": 10,
|
||||||
|
"top": "center"
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"echarts_timeseries": {
|
||||||
|
"xAxis": {
|
||||||
|
"axisLabel": {
|
||||||
|
"rotate": 45,
|
||||||
|
"fontSize": 12
|
||||||
|
}
|
||||||
|
},
|
||||||
|
"dataZoom": [
|
||||||
|
{
|
||||||
"type": "slider",
|
"type": "slider",
|
||||||
"show": True,
|
"show": "True",
|
||||||
"start": 0,
|
"start": 0,
|
||||||
"end": 100
|
"end": 100
|
||||||
}]
|
}
|
||||||
},
|
]
|
||||||
"echarts_bubble": {
|
},
|
||||||
|
"echarts_bubble": {
|
||||||
"grid": {
|
"grid": {
|
||||||
"left": "15%",
|
"left": "15%",
|
||||||
"bottom": "20%"
|
"bottom": "20%"
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
|
||||||
```
|
```
|
||||||
|
|
||||||
### UI Configuration
|
### UI Configuration
|
||||||
@@ -305,22 +311,22 @@ You can also configure ECharts overrides through the theme CRUD interface:
|
|||||||
```json
|
```json
|
||||||
{
|
{
|
||||||
"token": {
|
"token": {
|
||||||
"colorPrimary": "#2893B3"
|
"colorPrimary": "#2893B3",
|
||||||
},
|
"echartsOptionsOverrides": {
|
||||||
"echartsOptionsOverrides": {
|
"grid": {
|
||||||
"grid": {
|
"left": "10%",
|
||||||
"left": "10%",
|
"right": "10%"
|
||||||
"right": "10%"
|
},
|
||||||
|
"tooltip": {
|
||||||
|
"backgroundColor": "rgba(0, 0, 0, 0.8)"
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"tooltip": {
|
"echartsOptionsOverridesByChartType": {
|
||||||
"backgroundColor": "rgba(0, 0, 0, 0.8)"
|
"pie": {
|
||||||
}
|
"legend": {
|
||||||
},
|
"orient": "vertical",
|
||||||
"echartsOptionsOverridesByChartType": {
|
"right": 10
|
||||||
"echarts_pie": {
|
}
|
||||||
"legend": {
|
|
||||||
"orient": "vertical",
|
|
||||||
"right": 10
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@@ -343,7 +349,7 @@ This ensures chart-specific overrides take precedence over global ones.
|
|||||||
Available chart types for `echartsOptionsOverridesByChartType`:
|
Available chart types for `echartsOptionsOverridesByChartType`:
|
||||||
|
|
||||||
- `echarts_timeseries` - Time series/line charts
|
- `echarts_timeseries` - Time series/line charts
|
||||||
- `echarts_pie` - Pie and donut charts
|
- `pie` - Pie and donut charts
|
||||||
- `echarts_bubble` - Bubble/scatter charts
|
- `echarts_bubble` - Bubble/scatter charts
|
||||||
- `echarts_funnel` - Funnel charts
|
- `echarts_funnel` - Funnel charts
|
||||||
- `echarts_gauge` - Gauge charts
|
- `echarts_gauge` - Gauge charts
|
||||||
@@ -383,47 +389,48 @@ THEME_DEFAULT = {
|
|||||||
```python
|
```python
|
||||||
# Complete corporate theme with ECharts customization
|
# Complete corporate theme with ECharts customization
|
||||||
THEME_DEFAULT = {
|
THEME_DEFAULT = {
|
||||||
"token": {
|
"token": {
|
||||||
"colorPrimary": "#1B4D3E",
|
"colorPrimary": "#1B4D3E",
|
||||||
"fontFamily": "Corporate Sans, Arial, sans-serif"
|
"fontFamily": "Corporate Sans, Arial, sans-serif",
|
||||||
},
|
|
||||||
"echartsOptionsOverrides": {
|
"echartsOptionsOverrides": {
|
||||||
"grid": {
|
"grid": {
|
||||||
"left": "8%",
|
"left": "8%",
|
||||||
"right": "8%",
|
"right": "8%",
|
||||||
"top": "12%",
|
"top": "12%",
|
||||||
"bottom": "12%"
|
"bottom": "12%"
|
||||||
},
|
},
|
||||||
|
"textStyle": {
|
||||||
|
"fontFamily": "Corporate Sans, Arial, sans-serif"
|
||||||
|
},
|
||||||
|
"title": {
|
||||||
"textStyle": {
|
"textStyle": {
|
||||||
"fontFamily": "Corporate Sans, Arial, sans-serif"
|
"color": "#1B4D3E",
|
||||||
},
|
"fontSize": 18,
|
||||||
"title": {
|
"fontWeight": "bold"
|
||||||
"textStyle": {
|
|
||||||
"color": "#1B4D3E",
|
|
||||||
"fontSize": 18,
|
|
||||||
"fontWeight": "bold"
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
}
|
||||||
},
|
},
|
||||||
"echartsOptionsOverridesByChartType": {
|
"echartsOptionsOverridesByChartType": {
|
||||||
"echarts_timeseries": {
|
"echarts_timeseries": {
|
||||||
"xAxis": {
|
"xAxis": {
|
||||||
"axisLabel": {
|
"axisLabel": {
|
||||||
"color": "#666",
|
"color": "#666",
|
||||||
"fontSize": 11
|
"fontSize": 11
|
||||||
}
|
}
|
||||||
}
|
|
||||||
},
|
|
||||||
"echarts_pie": {
|
|
||||||
"legend": {
|
|
||||||
"textStyle": {
|
|
||||||
"fontSize": 12
|
|
||||||
},
|
|
||||||
"itemGap": 20
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
},
|
||||||
|
"pie": {
|
||||||
|
"legend": {
|
||||||
|
"textStyle": {
|
||||||
|
"fontSize": 12
|
||||||
|
},
|
||||||
|
"itemGap": 20
|
||||||
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
```
|
```
|
||||||
|
|
||||||
This feature provides powerful theming capabilities while maintaining the flexibility of ECharts' extensive configuration options.
|
This feature provides powerful theming capabilities while maintaining the flexibility of ECharts' extensive configuration options.
|
||||||
|
|||||||
Reference in New Issue
Block a user