| name | dc-chart-config |
| description | Configure chart axis mappings and display options for all chart types in Drizzle Cube. |
Chart Config Skill
This skill helps you configure charts using ChartAxisConfig and ChartDisplayConfig for optimal visualizations.
ChartAxisConfig
Maps data fields to chart axes:
interface ChartAxisConfig {
xAxis?: string[]
yAxis?: string[]
series?: string[]
sizeField?: string
colorField?: string
dateField?: string[]
valueField?: string[]
yAxisAssignment?: Record<string, 'left' | 'right'>
}
ChartDisplayConfig
Controls visual appearance:
interface ChartDisplayConfig {
showLegend?: boolean
showGrid?: boolean
showTooltip?: boolean
colors?: string[]
orientation?: 'horizontal' | 'vertical'
stackType?: 'none' | 'normal' | 'percent'
xAxisFormat?: AxisFormatConfig
leftYAxisFormat?: AxisFormatConfig
rightYAxisFormat?: AxisFormatConfig
prefix?: string
suffix?: string
decimals?: number
valueColorIndex?: number
positiveColorIndex?: number
negativeColorIndex?: number
showHistogram?: boolean
funnelStyle?: 'bars' | 'funnel'
funnelOrientation?: 'horizontal' | 'vertical'
showFunnelConversion?: boolean
showFunnelAvgTime?: boolean
content?: string
fontSize?: 'small' | 'medium' | 'large'
alignment?: 'left' | 'center' | 'right'
pivotTimeDimension?: boolean
}
Axis Format Config
interface AxisFormatConfig {
unit?: 'number' | 'currency' | 'percent' | 'duration' | 'bytes'
abbreviate?: boolean
decimals?: number
currencyCode?: string
prefix?: string
suffix?: string
}
Chart Type Reference
Bar Chart
chartType: 'bar'
chartConfig: {
xAxis: ['Products.category'],
yAxis: ['Sales.revenue', 'Sales.count']
}
displayConfig: {
orientation: 'vertical',
stackType: 'none',
showLegend: true,
showGrid: true
}
Stacked Bar:
displayConfig: {
stackType: 'normal',
stackType: 'percent'
}
Horizontal Bar:
displayConfig: {
orientation: 'horizontal'
}
Line Chart
chartType: 'line'
chartConfig: {
xAxis: ['Orders.createdAt'],
yAxis: ['Sales.revenue']
}
displayConfig: {
showLegend: true,
showGrid: true,
showTooltip: true
}
Multiple Series:
chartConfig: {
xAxis: ['Orders.createdAt'],
yAxis: ['Sales.revenue'],
series: ['Products.category']
}
Area Chart
chartType: 'area'
chartConfig: {
xAxis: ['Orders.createdAt'],
yAxis: ['Sales.revenue']
}
displayConfig: {
stackType: 'normal',
showLegend: true
}
Pie Chart
chartType: 'pie'
chartConfig: {
xAxis: ['Products.category'],
yAxis: ['Sales.revenue']
}
displayConfig: {
showLegend: true,
showTooltip: true
}
Scatter Plot
chartType: 'scatter'
chartConfig: {
xAxis: ['Employees.experience'],
yAxis: ['Employees.salary']
}
displayConfig: {
showGrid: true,
showTooltip: true
}
Bubble Chart
chartType: 'bubble'
chartConfig: {
xAxis: ['Products.price'],
yAxis: ['Products.rating'],
sizeField: 'Products.salesCount',
colorField: 'Products.category'
}
displayConfig: {
showLegend: true
}
Radar Chart
chartType: 'radar'
chartConfig: {
xAxis: ['Skills.name'],
yAxis: ['Employees.score']
}
displayConfig: {
showLegend: true
}
Data Table
chartType: 'table'
chartConfig: {}
displayConfig: {
pivotTimeDimension: true
}
KPI Number
Single value display:
chartType: 'kpiNumber'
chartConfig: {
yAxis: ['Sales.totalRevenue']
}
displayConfig: {
prefix: '$',
suffix: '',
decimals: 0,
valueColorIndex: 0
}
KPI Delta
Shows change between periods:
chartType: 'kpiDelta'
chartConfig: {
yAxis: ['Sales.totalRevenue']
}
displayConfig: {
prefix: '$',
decimals: 0,
positiveColorIndex: 2,
negativeColorIndex: 1,
showHistogram: true
}
Query for KPI Delta:
query: {
measures: ['Sales.totalRevenue'],
timeDimensions: [{
dimension: 'Sales.createdAt',
granularity: 'month',
compareDateRange: [
['2024-02-01', '2024-02-29'],
['2024-01-01', '2024-01-31']
]
}]
}
Funnel Chart
chartType: 'funnel'
chartConfig: {}
displayConfig: {
funnelStyle: 'funnel',
funnelOrientation: 'horizontal',
showFunnelConversion: true,
showFunnelAvgTime: true
}
Sankey (Flow) Chart
chartType: 'sankey'
chartConfig: {}
displayConfig: {}
Activity Grid (Heatmap)
chartType: 'activityGrid'
chartConfig: {
dateField: ['Events.date'],
valueField: ['Events.count']
}
displayConfig: {
showTooltip: true
}
Markdown
chartType: 'markdown'
chartConfig: {}
displayConfig: {
content: '# Title\n\nSome **markdown** content',
fontSize: 'medium',
alignment: 'center'
}
Treemap
chartType: 'treemap'
chartConfig: {
xAxis: ['Products.category', 'Products.subcategory'],
yAxis: ['Sales.revenue']
}
displayConfig: {
showTooltip: true
}
Dual-Axis Configuration
For charts with different scales:
chartConfig: {
xAxis: ['Orders.createdAt'],
yAxis: ['Sales.revenue', 'Sales.count'],
yAxisAssignment: {
'Sales.revenue': 'left',
'Sales.count': 'right'
}
}
displayConfig: {
leftYAxisFormat: {
unit: 'currency',
abbreviate: true
},
rightYAxisFormat: {
unit: 'number'
}
}
Common Display Patterns
Currency Formatting
displayConfig: {
leftYAxisFormat: {
unit: 'currency',
currencyCode: 'USD',
abbreviate: true,
decimals: 0
}
}
Percentage Formatting
displayConfig: {
leftYAxisFormat: {
unit: 'percent',
decimals: 1
}
}
Duration Formatting
displayConfig: {
leftYAxisFormat: {
unit: 'duration'
}
}
Custom Colors
displayConfig: {
colors: ['#3b82f6', '#ef4444', '#10b981', '#f59e0b']
}
Chart Selection Guide
| Data Type | Recommended Chart | Why |
|---|
| Single value | kpiNumber | Clear, prominent display |
| Period comparison | kpiDelta | Shows change direction |
| Trend over time | line | Shows progression |
| Category comparison | bar | Easy comparison |
| Part of whole | pie | Shows proportions |
| Correlation | scatter | Shows relationships |
| 3+ dimensions | bubble | Size/color encoding |
| Detailed data | table | Full data access |
| Conversions | funnel | Step-by-step drop-off |
| User journeys | sankey | Path visualization |
| Activity patterns | activityGrid | Calendar heatmap |
Best Practices
- Match chart to question - Use line for "how did it change?", bar for "how do they compare?"
- Limit categories - Pie charts work best with 5-7 slices max
- Use consistent colors - Stick to the palette
- Format appropriately - Use abbreviation for large numbers
- Show legends when needed - Required for multiple series
- Enable tooltips - Helps users explore data
- Consider mobile - Horizontal bars may work better on small screens