TX Sheet Control

DashboardChartSettings Interface

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

PropertyDescription
axisConfigures axis on DashboardChartSettings; apply the complete settings object through its owning dashboard.
secondaryAxisConfigures secondaryAxis on DashboardChartSettings; apply the complete settings object through its owning dashboard.
referenceLinesConfigures referenceLines on DashboardChartSettings; apply the complete settings object through its owning dashboard.
targetConfigures target on DashboardChartSettings; apply the complete settings object through its owning dashboard.
bandsConfigures bands on DashboardChartSettings; apply the complete settings object through its owning dashboard.
missingValuesConfigures missingValues on DashboardChartSettings; apply the complete settings object through its owning dashboard.
labelPositionConfigures labelPosition on DashboardChartSettings; apply the complete settings object through its owning dashboard.
conditionalColorsConfigures conditionalColors on DashboardChartSettings; apply the complete settings object through its owning dashboard.
xFieldConfigures xField on DashboardChartSettings; apply the complete settings object through its owning dashboard.
yFieldConfigures yField on DashboardChartSettings; apply the complete settings object through its owning dashboard.
sizeFieldConfigures sizeField on DashboardChartSettings; apply the complete settings object through its owning dashboard.
categoryFieldConfigures categoryField on DashboardChartSettings; apply the complete settings object through its owning dashboard.
panelFieldConfigures panelField on DashboardChartSettings; apply the complete settings object through its owning dashboard.
secondaryMeasureConfigures secondaryMeasure on DashboardChartSettings; apply the complete settings object through its owning dashboard.
binsHistogram bin count, 1..100; defaults to the square root of numeric observations, capped at 30.
totalsCategory labels whose waterfall bars are absolute totals rather than relative contributions.
mapFeaturesLocal 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.

async function configureSalesDashboard(book) {
    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 = {
        "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 };
}