DashboardChartSettings Interface
Chart marks share query aliases rather than raw data access. Map geometry is supplied by the application, offline.
Package: @txtextcontrol/tx-sheet-control. This is a settings/result contract, not a runtime constructor.
Members
| Property | Description |
|---|---|
| axis | Configures axis on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| secondaryAxis | Configures secondaryAxis on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| referenceLines | Configures referenceLines on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| target | Configures target on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| bands | Configures bands on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| missingValues | Configures missingValues on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| labelPosition | Configures labelPosition on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| conditionalColors | Configures conditionalColors on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| xField | Configures xField on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| yField | Configures yField on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| sizeField | Configures sizeField on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| categoryField | Configures categoryField on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| panelField | Configures panelField on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| secondaryMeasure | Configures secondaryMeasure on DashboardChartSettings; apply the complete settings object through its owning dashboard. |
| bins | Histogram bin count, 1..100; defaults to the square root of numeric observations, capped at 30. |
| totals | Category labels whose waterfall bars are absolute totals rather than relative contributions. |
| mapFeatures | Local GeoJSON-like Polygon/MultiPolygon features; coordinates are longitude/latitude, no network requests. |
Examples
Configure a complete sales dashboard using this contract. Pass the workbook from your existing editor or server control.
import type { Workbook, DashboardChartSettings } 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: DashboardChartSettings = {
"axis": {
"minimum": 0,
"maximum": 200000,
"title": "Revenue (USD)",
"scale": "linear",
"showGridlines": true
},
"secondaryAxis": {
"minimum": 0,
"maximum": 60000,
"title": "Profit (USD)"
},
"referenceLines": [
{
"value": 100000,
"label": "Regional Target",
"color": "#B38538",
"dashed": true
}
],
"target": 100000,
"bands": [
{
"maximum": 200000,
"color": "#DCE8F2"
},
{
"maximum": 100000,
"color": "#9EBFDB"
}
],
"missingValues": "gap",
"labelPosition": "inside",
"conditionalColors": [
{
"field": "Revenue",
"operator": "lessThan",
"value": 50000,
"color": "#CD526B"
}
],
"xField": "Revenue",
"yField": "Profit",
"sizeField": "Units",
"categoryField": "Region",
"panelField": "Country",
"secondaryMeasure": "Profit",
"bins": 8,
"totals": [
"Total"
],
"mapFeatures": [
{
"key": "Europe",
"type": "Polygon",
"coordinates": [
[
[
0,
40
],
[
25,
40
],
[
25,
60
],
[
0,
60
],
[
0,
40
]
]
]
}
]
};
dashboard.updateWidget('revenue', { chart: settings });
book.activeView = { type: 'dashboard', id: dashboard.id };
}