import type { Table } from "../table.js"; import type { Worksheet } from "../worksheet.js"; import type { AddChartExOptions } from "./chart-ex-types.js"; import type { AddChartOptions, AddChartSeriesOptions } from "./types.js"; export interface SeriesFromColumnsOptions { categories?: string; values: string; name?: AddChartSeriesOptions["name"]; } export interface AddChartFromTableOptions extends Omit { categoryColumn?: string | number; valueColumns?: Array; /** Use Excel structured references so charts expand with the table. Default: true. */ structuredReferences?: boolean; } export interface AddChartFromRowsOptions> extends Omit { x: keyof T & string; y: (keyof T & string) | Array; sheetName?: string; startCell?: string; includeHeaders?: boolean; } export declare function seriesFromColumns(sheetName: string, options: SeriesFromColumnsOptions): AddChartSeriesOptions; export declare function chartOptionsFromTable(worksheet: Worksheet, table: Table | string, options: AddChartFromTableOptions): AddChartOptions; export declare function chartOptionsFromRows>(worksheet: Worksheet, rows: T[], options: AddChartFromRowsOptions): AddChartOptions; /** * Shared options for ChartEx helpers that derive series references from an * existing worksheet Table. The `type` is narrowed per-helper (histogram, * sunburst, treemap, waterfall, funnel, pareto, boxWhisker) because * `regionMap` requires geographic labels that don't map cleanly from a * generic category column. Column resolution mirrors * {@link AddChartFromTableOptions}: string matches the header * case-insensitively, number is a 0-based index. */ export interface AddChartExFromTableOptions extends Omit { /** * The category column. String is matched case-insensitively against the * table header; number is a 0-based index. Default: 0. */ categoryColumn?: string | number; /** * The value columns. Each produces one `cx:series`. Defaults to every * non-category column. */ valueColumns?: Array; /** * Use Excel structured references (`Table1[Col]`) so the chart tracks * table expansion. Default: true. When `false`, classic absolute * ranges (`Sheet1!$B$2:$B$10`) are emitted instead. */ structuredReferences?: boolean; } /** * Shared options for ChartEx helpers that derive series from a plain * JavaScript object array, mirroring {@link AddChartFromRowsOptions}. The * helper writes the rows into the worksheet first (headers optional) and * then emits the corresponding absolute ranges. */ export interface AddChartExFromRowsOptions> extends Omit { /** Key used as the category column. */ x: keyof T & string; /** * Key(s) used as value column(s). Each produces one `cx:series`. */ y: (keyof T & string) | Array; /** Target worksheet name. Must match the worksheet this helper is invoked on. */ sheetName?: string; /** Top-left cell for the staged data. Default: `A1`. */ startCell?: string; /** Emit a header row before the data. Default: `true`. */ includeHeaders?: boolean; } /** * Build an {@link AddChartExOptions} bundle by pointing at a worksheet Table. * * Mirrors {@link chartOptionsFromTable} for classic charts. The builder * resolves the table's data range and populates `categories` + one * series per value column. `regionMap` is intentionally unsupported * because its data model expects geographic labels that don't fit a * flat-column helper — use {@link buildChartExModel} directly. */ export declare function chartExOptionsFromTable(worksheet: Worksheet, table: Table | string, options: AddChartExFromTableOptions & { type: Exclude; }): AddChartExOptions; /** * Build an {@link AddChartExOptions} bundle from a plain object-array * dataset, staging the rows into the worksheet before emitting ranges. * Mirrors {@link chartOptionsFromRows} for classic charts. */ export declare function chartExOptionsFromRows>(worksheet: Worksheet, rows: T[], options: AddChartExFromRowsOptions & { type: Exclude; }): AddChartExOptions;