DashboardWidgetAppearance Interface
Portable widget presentation, shared by browser authoring and headless rendering. Sizes are points (8..72); colors are six-digit hex. Omitted fields inherit the dashboard defaults.
Package: @txtextcontrol/tx-sheet-control. This is a settings/result contract, not a runtime constructor.
Members
| Property | Description |
|---|---|
| backgroundColor | Configures backgroundColor on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| gradient | Portable color stops; backgrounds render identically in browser and headless SVG. |
| padding | Card geometry in CSS pixels; padding 0..48, radius 0..32, border 0..8. |
| borderRadius | Configures borderRadius on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| borderWidth | Configures borderWidth on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| shadow | Soft card shadow. Opacity 0..1, blur 0..40, offset -20..20 CSS pixels. |
| borderColor | Configures borderColor on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| titleColor | Configures titleColor on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| titleFontSize | Configures titleFontSize on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| showTitle | Configures showTitle on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| textColor | Configures textColor on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| fontFamily | Configures fontFamily on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| fontSize | Configures fontSize on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| bold | Configures bold on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| italic | Configures italic on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| underline | Configures underline on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| horizontalAlign | Configures horizontalAlign on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| chartColors | Ordered palette, 1..12 colors. Bar/line series and pie/donut categories cycle through it. |
| legend | Configures legend on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| showDataLabels | Configures showDataLabels on DashboardWidgetAppearance; apply the complete settings object through its owning dashboard. |
| animation | Quick chart entrance animation; defaults to true. Browser reduced-motion preferences always take precedence. |
Examples
Configure a complete sales dashboard using this contract. Pass the workbook from your existing editor or server control.
import type { Workbook, DashboardWidgetAppearance } from '@txtextcontrol/tx-sheet-control';
async function configureSalesDashboard(book: Workbook) {
const sheet = book.sheets.at(0);
sheet.range('A1:G5').setValues([
['Region', 'Country', 'Customer', 'Revenue', 'Profit', 'Date', 'Units'],
['Europe', 'Germany', 'Studio', 42000, 12000, '2026-01-15', 12],
['Europe', 'France', 'Labs', 38000, 9000, '2026-02-15', 15],
['Americas', 'Canada', 'Partners', 31000, 8000, '2026-01-15', 9],
['Americas', 'United States', 'Design', 49000, 15000, '2026-02-15', 18]
]);
book.analytics.setSource({ id: 'sales', name: 'Sales', sheetId: sheet.id, range: 'A1:G5', hasHeaderRow: true });
const dashboard = book.dashboards.add('Sales Performance');
dashboard.update({ sections: [{ id: 'summary', title: 'Executive Summary' }] });
dashboard.addWidget({
id: 'revenue', type: 'column', title: 'Regional Revenue',
placement: { x: 0, y: 0, width: 8, height: 6 },
query: { sourceId: 'sales', dimensions: ['Region'], measures: [
{ field: 'Revenue', aggregation: 'SUM', alias: 'Revenue' },
{ field: 'Profit', aggregation: 'SUM', alias: 'Profit' }
] }
});
const settings: DashboardWidgetAppearance = {
"gradient": {
"type": "linear",
"angle": 135,
"stops": [
{
"offset": 0,
"color": "#12335A"
},
{
"offset": 1,
"color": "#376E9C"
}
]
},
"padding": 20,
"borderRadius": 16,
"borderWidth": 1,
"shadow": {
"color": "#000000",
"opacity": 0.12,
"blur": 16,
"offsetX": 0,
"offsetY": 4
},
"fontFamily": "Noto Sans",
"fontSize": 11,
"textColor": "#F2F6FF",
"backgroundColor": "#17385A",
"titleColor": "#FFFFFF",
"borderColor": "#496586",
"titleFontSize": 13,
"showTitle": true,
"bold": false,
"italic": false,
"underline": false,
"horizontalAlign": "left",
"chartColors": [
"#75B5FF",
"#5CD4B4"
],
"legend": "bottom",
"showDataLabels": true,
"animation": true
};
dashboard.updateWidget('revenue', { appearance: settings });
book.activeView = { type: 'dashboard', id: dashboard.id };
}