/** * Classic DrawingML charts (`c:chartSpace`) for worksheet embedding. * * Public surface follows Syncfusion XlsIO chart authoring purpose and names * (camelCase): `addChart`, `chartTitle`/`hasTitle`, `dataRange`/`isSeriesInRows`, * `addSeries`/`categoryLabels`/`values`, `primaryCategoryAxis`/`primaryValueAxis`, * `hasLegend`/`legend.position`, and anchor `row`/`column`/`width`/`height` * (XlsIO TopRow/LeftColumn + size). Load/parse/serialize is this library's * OOXML model — not a port of XlsIO internals. * * Host-agnostic chart.xml parse/serialize is shared for DOCX/PPTX reuse. * XLSX owns the spreadsheetDrawing graphicFrame adapter only. * * Citations: * - docs/specs/charts.md; docs/requirements/charts.md; docs/ooxml-mapping/charts.md * - docs/api/API-RULES.md (R1.1 properties, add* / remove*; R1.5 one name; no TS enums) * - Syncfusion XlsIO IChartShape / ExcelChartType (API names/purpose only) * - dml-chart.xsd CT_ChartSpace / CT_Chart / CT_PlotArea / CT_View3D / CT_ExternalData * - dml-spreadsheetDrawing.xsd graphicFrame anchors * * @private implementation; public types are exported from the package root. */ import { OpcPackage } from '../core/package/opc-package'; import { OpcRelationship } from '../core/package/relationships'; /** * Chart layouts you can pass as the first argument to {@link Worksheet.addChart}. * Covers standard Excel charts (column, bar, line, pie, scatter, bubble, area, 3-D) * and extended layouts (funnel, waterfall, box-and-whisker, Pareto, treemap, sunburst). * * Prefer the specific tokens (for example `ColumnClustered`, not the deprecated * coarse aliases like `Column`). Use as `ChartType.ColumnClustered`, not a TypeScript enum. */ export declare const ChartType: { ColumnClustered: string; ColumnStacked: string; ColumnPercentStacked: string; /** @deprecated Prefer {@link ChartType.ColumnClustered}. */ Column: string; BarClustered: string; BarStacked: string; BarPercentStacked: string; /** @deprecated Prefer {@link ChartType.BarClustered}. */ Bar: string; /** A line connecting one value per category. */ Line: string; /** Lines stacked, showing cumulative contribution. */ LineStacked: string; /** Lines stacked to 100%, showing each series' share of the total. */ LinePercentStacked: string; /** A line chart with a dot marking each data point. */ LineMarkers: string; /** Stacked lines with a dot marking each data point. */ LineStackedMarkers: string; /** 100% stacked lines with a dot marking each data point. */ LinePercentStackedMarkers: string; /** A pie chart showing each value's share of a total. */ Pie: string; /** Pie with slices pulled away from the center. */ PieExploded: string; /** Pie of pie (main pie plus a second pie for small slices). */ PieOfPie: string; /** Bar of pie (main pie plus a bar for small slices). */ BarOfPie: string; /** Doughnut chart. */ Doughnut: string; /** Doughnut with slices pulled away from the center. */ DoughnutExploded: string; /** Scatter points shown as markers only, without connecting lines. */ ScatterMarkers: string; /** Scatter points connected by straight lines. */ ScatterLine: string; /** Scatter points connected by straight lines, with a marker on each point. */ ScatterLineMarkers: string; /** Scatter points connected by a smooth curved line. */ ScatterSmooth: string; /** Scatter points connected by a smooth curved line, with a marker on each point. */ ScatterSmoothMarkers: string; /** * Scatter points shown as markers only. Alias of `ScatterMarkers`. * @deprecated Prefer {@link ChartType.ScatterMarkers}. */ Scatter: string; /** A bubble chart where each point's size carries a third value. */ Bubble: string; /** A bubble chart whose bubbles have a 3-D shaded look. */ Bubble3D: string; /** A filled area under a line, one per series. */ Area: string; /** Filled areas stacked on top of each other. */ AreaStacked: string; /** Filled areas stacked to 100%, showing each series' share of the total. */ AreaPercentStacked: string; /** A true 3-D column chart with depth, viewed at an angle. */ Column3D: string; /** 3-D columns grouped side by side. */ ColumnClustered3D: string; /** 3-D columns stacked front to back. */ ColumnStacked3D: string; /** 3-D columns stacked to 100%. */ ColumnPercentStacked3D: string; /** 3-D horizontal bars grouped side by side. */ BarClustered3D: string; /** * 3-D horizontal bars grouped side by side. Alias of `BarClustered3D`. * @deprecated Prefer {@link ChartType.BarClustered3D}. */ Bar3D: string; /** 3-D horizontal bars stacked. */ BarStacked3D: string; /** 3-D horizontal bars stacked to 100%. */ BarPercentStacked3D: string; /** A line chart drawn with 3-D depth. */ Line3D: string; /** A pie chart drawn with 3-D depth. */ Pie3D: string; /** A 3-D pie chart with the slices pulled slightly apart. */ PieExploded3D: string; /** A 3-D area chart with filled sides. */ Area3D: string; /** A 3-D area chart, stacked. */ AreaStacked3D: string; /** A 3-D area chart, stacked to 100%. */ AreaPercentStacked3D: string; /** A 3-D surface chart showing values as a continuous landscape. */ Surface3D: string; /** Box-and-whisker statistical chart. */ BoxAndWhisker: string; /** Funnel chart. */ Funnel: string; /** Pareto chart (bars plus cumulative line). */ Pareto: string; /** Sunburst hierarchical chart. */ Sunburst: string; /** Treemap hierarchical chart. */ TreeMap: string; /** Waterfall chart. */ Waterfall: string; }; /** * A chart type string (values of the {@link ChartType} object). * Prefer `ChartType.*` at call sites. Merged with the `ChartType` const. */ export declare type ChartType = (typeof ChartType)[keyof typeof ChartType]; /** Extended layout values on {@link ChartType} (funnel, waterfall, and related). */ export declare type ChartExLayoutValue = typeof ChartType.BoxAndWhisker | typeof ChartType.Funnel | typeof ChartType.Pareto | typeof ChartType.Sunburst | typeof ChartType.TreeMap | typeof ChartType.Waterfall; /** Standard chart types only (excludes funnel, waterfall, and other extended layouts). */ export declare type ClassicChartType = Exclude; /** * Where the legend appears on the chart. * Use with {@link ChartLegend.position}. */ export declare const LegendPosition: { Bottom: string; Top: string; Left: string; Right: string; Corner: string; }; export declare type LegendPositionValue = (typeof LegendPosition)[keyof typeof LegendPosition]; /** * Where data labels sit relative to each point or slice. * Use with {@link ChartDataLabels.position}. */ export declare const DataLabelPosition: { Center: string; InsideBase: string; InsideEnd: string; OutsideEnd: string; BestFit: string; Left: string; Right: string; Top: string; Bottom: string; }; export declare type DataLabelPositionValue = (typeof DataLabelPosition)[keyof typeof DataLabelPosition]; /** * Axis tick mark style (none, inside, outside, or crossing the axis). * Use with {@link ChartAxis.majorTickMark} / {@link ChartAxis.minorTickMark}. */ export declare const TickMarkType: { None: string; Inside: string; Outside: string; Cross: string; }; export declare type TickMarkTypeValue = (typeof TickMarkType)[keyof typeof TickMarkType]; /** * Fill mode for chart areas and series: solid color or no fill. * Use as `ChartFillType.Solid` / `ChartFillType.None`. */ export declare const ChartFillType: { Solid: string; None: string; }; /** * String values of {@link ChartFillType}. Prefer `ChartFillType.*` at call sites. */ export declare type ChartFillTypeValue = (typeof ChartFillType)[keyof typeof ChartFillType]; /** * Fill for a chart area, plot area, legend box, or series. * Use {@link ChartFillType.Solid} with `foreColor`, or {@link ChartFillType.None}. * Colors are RRGGBB or #RRGGBB. Transparency is 0–100 (0 = fully opaque). */ export interface ChartFill { type: ChartFillTypeValue; foreColor: string | undefined; transparency: number | undefined; } /** * Line or border styling (axis line, series line, frame border). * `weightPt` is stroke thickness in points. */ export interface ChartLineFormat { color: string | undefined; weightPt: number | undefined; } /** * Font styling for chart title, legend text, axis titles, and data labels. * `size` is font size in points. */ export interface ChartTextArea { fontName: string | undefined; size: number | undefined; bold: boolean; italic: boolean; color: string | undefined; } /** * Fill and border for a framed region (chart area, plot area, or legend box). */ export interface ChartFrameFormat { readonly fill: ChartFill; readonly line: ChartLineFormat; } /** * What each data point shows as a label (value, category, series name, percent) * and where the label is placed. */ export interface ChartDataLabels { isValue: boolean; isCategoryName: boolean; isSeriesName: boolean; isPercentage: boolean; position: DataLabelPositionValue | undefined; readonly textArea: ChartTextArea; } /** * Fill and line styling for one series (bars, lines, markers outline, etc.). */ export interface ChartSerieFormat { readonly fill: ChartFill; readonly line: ChartLineFormat; } /** * Bar/column grouping (dml-chart ST_BarGrouping). * `standard` is used for true 3-D Column (`Column3D`); 2-D column/bar use * clustered|stacked|percentStacked. */ export declare type BarGrouping = 'clustered' | 'stacked' | 'percentStacked' | 'standard'; /** Area/line grouping (dml-chart ST_Grouping). */ export declare type AreaGrouping = 'standard' | 'stacked' | 'percentStacked'; /** Scatter style (dml-chart ST_ScatterStyle). */ export declare type ScatterStyle = 'none' | 'line' | 'lineMarker' | 'marker' | 'smooth' | 'smoothMarker'; /** Of-pie secondary plot type (dml-chart ST_OfPieType). */ export declare type OfPieType = 'pie' | 'bar'; /** * Chart data package relationship state (`c:externalData`). * Absent externalData is `none`, never silently `embedded`. * * Not part of the end-user root surface. DocIO/PPTX and other host products * import this type from `@syncfusion/ej2-xlsx/internal/charts`. Public * {@link Chart} intentionally omits `dataSource`; host products use * `ChartHost` / `getChartDataSource` / `setChartDataSource` on the internal * subpath (and the runtime getters/setters on the chart handle). */ export declare type ChartDataSource = { readonly kind: 'embedded'; readonly relationshipId: string; } | { readonly kind: 'external'; readonly relationshipId: string; readonly target?: string; } | { readonly kind: 'none'; }; /** * Optional 3-D camera settings for 3-D chart types (rotation, depth, perspective). */ export interface ChartView3D { /** Tilt up/down in degrees (−90…90). */ rotationX?: number; /** Spin left/right in degrees (0…360). */ rotationY?: number; /** Relative 3-D height percent (5…500). */ heightPercent?: number; /** Relative 3-D depth percent (20…2000). */ depthPercent?: number; /** When true, axes stay at right angles (isometric-style view). */ rightAngleAxis?: boolean; /** Perspective strength (0…240). */ perspective?: number; } /** Position and size of a chart on the sheet (row/column are 1-based; size is in points). */ export interface ChartAnchor { readonly row: number; readonly column: number; /** Width in points (72 points = 1 inch). */ readonly width: number; /** Height in points (72 points = 1 inch). */ readonly height: number; } /** * Data-only descriptor for {@link Worksheet.addChart} when a single range * string or category/values pair is not enough (ChartEx hierarchy, cached * points, or `isSeriesInRows` with other fields). * * Presentation (title, legend, name, axes, grouping) is set on the returned * {@link Chart} handle after creation. Additional series are added with * {@link Chart.addSeries}. */ export interface ChartData { /** * Cell range that holds the chart data, including headers * (for example `A1:C4` or `Sheet1!A1:C4`). */ readonly dataRange?: string; /** * When `true`, each row is a series. Default `false` (each column is a series). */ readonly isSeriesInRows?: boolean; /** * Category labels formula, or several formulas for hierarchy levels * (treemap / sunburst). Extended layouts and single-series classic seed. */ readonly categoryLabels?: string | ReadonlyArray; /** * Values formula (or size values for treemap / sunburst). Extended layouts * and single-series classic seed. */ readonly values?: string; /** * Category labels as plain strings (no worksheet formula). Extended layouts * only. Do not combine with formula {@link categoryLabels} or {@link dataRange}. */ readonly categories?: ReadonlyArray | ReadonlyArray<(ReadonlyArray)>; /** Optional display names for cached category levels (extended layouts). */ readonly categoryNames?: ReadonlyArray; /** Numeric values as plain numbers (no formula). Extended layouts only. */ readonly valuePoints?: ReadonlyArray; /** Number format for numeric values on extended layouts (for example `0%`). */ readonly formatCode?: string; } /** One series on a chart after it has been created (title, values, format, labels). */ export interface ChartSeries { /** Series name in the legend. */ title: string | undefined; /** Category / X labels formula. */ categoryLabels: string | undefined; /** Values / Y formula. */ values: string; /** * Bubble-size formula for bubble charts. * When omitted, Excel uses default sizes. */ bubbleSizes: string | undefined; /** * Whether this bubble series uses a 3-D bubble look. * Defaults to `true` for {@link ChartType.Bubble3D}, otherwise `false`. */ bubbleSize3D: boolean; /** * How far pie/doughnut slices pull out from the center (0–400 percent). * Overrides the default for exploded doughnut/pie types when set. */ explodePercent: number | undefined; /** Fill and line styling for this series. */ readonly serieFormat: ChartSerieFormat; /** Data labels for this series. */ readonly dataLabels: ChartDataLabels; } /** Category or value axis: title, scale, gridlines, ticks, and line style. */ export interface ChartAxis { /** Axis title text. */ title: string | undefined; /** * Whether the axis is drawn. Defaults to `true` on create; set `false` to * hide (`c:delete`). Load/parse follows package truth. */ visible: boolean; /** * Major gridlines across the plot area. Defaults to `true` on create; set * `false` to hide. Load/parse follows package truth. Pie/doughnut plots omit * axes on the wire regardless of this flag. */ hasMajorGridLines: boolean; /** * Minor gridlines across the plot area. Defaults to `false` on create * (Excel-like); set `true` to show. */ hasMinorGridLines: boolean; /** Number format for tick labels (for example `#,##0` or `0%`). */ numberFormat: string | undefined; /** Fixed axis minimum; omit to let Excel auto-scale. */ minimumValue: number | undefined; /** Fixed axis maximum; omit to let Excel auto-scale. */ maximumValue: number | undefined; /** Major tick mark style ({@link TickMarkType}). */ majorTickMark: TickMarkTypeValue; /** Minor tick mark style ({@link TickMarkType}). */ minorTickMark: TickMarkTypeValue; /** Axis line color and thickness. */ readonly line: ChartLineFormat; /** Font styling for the axis title. */ readonly titleArea: ChartTextArea; } /** Legend: placement, text styling, and box fill/border. */ export interface ChartLegend { /** Where the legend appears ({@link LegendPosition}). */ position: LegendPositionValue; /** Font styling for legend entries. */ readonly textArea: ChartTextArea; /** Legend box fill and border. */ readonly frameFormat: ChartFrameFormat; } /** * Live chart on a worksheet. Returned by {@link Worksheet.addChart}. * Change type, data, axes, legend, and formatting, then save the workbook. */ export interface Chart { /** * Chart layout ({@link ChartType}). Do not switch between a standard chart * and an extended layout (funnel, waterfall, …) on the same instance — * create a new chart instead. */ type: ChartType; /** * Which format this chart uses internally: * - `'classic'` — standard Excel charts (column, line, pie, …) * - `'chartex'` — extended layouts (funnel, waterfall, treemap, …) */ readonly engine: 'classic' | 'chartex'; /** Optional name for the chart object. */ name: string; /** * Chart title text. New charts default to an empty title with * {@link hasTitle} enabled; set text or set `hasTitle = false` to hide. */ chartTitle: string | undefined; /** * Whether the title is shown. Defaults to `true` on create (with empty * {@link chartTitle}); set `false` to hide. Load/parse follows package truth. */ hasTitle: boolean; /** Font styling for the chart title. */ readonly chartTitleArea: ChartTextArea; /** Outer chart border and background fill. */ readonly chartArea: ChartFrameFormat; /** Plot area (the region that holds series) fill and border. */ readonly plotArea: ChartFrameFormat; /** * Source data range (A1 style). Setting a non-empty range rebuilds series * from that range. */ dataRange: string | undefined; /** When `true`, series come from rows; otherwise from columns. */ isSeriesInRows: boolean; /** Stacking style when not fully encoded by {@link type}. */ grouping: BarGrouping | AreaGrouping | undefined; /** Scatter marker/line style when not fully encoded by {@link type}. */ scatterStyle: ScatterStyle | undefined; /** 3-D view settings for 3-D chart types. */ view3D: ChartView3D | undefined; /** * The row the chart's top edge is anchored to — 1-based, like Excel * rows. Setting `row` snaps the top edge to the row boundary (zero rowOff). */ row: number; /** * The column the chart's left edge is anchored to — 1-based, like * Excel columns (1 = A). Setting `column` snaps the left edge to the * column boundary (zero colOff). */ column: number; /** * Absolute distance in points from the top of the sheet (row 1) to the * top edge of the chart (XlsIO `IShape.Top`). Setting `top` rewrites * `row` and DrawingML `xdr:rowOff` from live row heights (Excel-like * defaults when heights are unset). */ top: number; /** * Absolute distance in points from the left of the sheet (column A) to * the left edge of the chart (XlsIO `IShape.Left`). Setting `left` * rewrites `column` and `xdr:colOff` from live column widths. */ left: number; /** Width in points (72 points = 1 inch). */ width: number; /** Height in points (72 points = 1 inch). */ height: number; /** * Whether the legend is shown. Defaults to `true` on create; set `false` * to hide. Load/parse follows package truth. */ hasLegend: boolean; /** Legend handle (position, text, frame). */ readonly legend: ChartLegend; /** * When `true`, show a data table under the plot. * Excel may ignore this on pure pie/doughnut charts. */ hasDataTable: boolean; /** Primary category (X) axis. */ readonly primaryCategoryAxis: ChartAxis; /** Primary value (Y) axis. */ readonly primaryValueAxis: ChartAxis; /** Series currently on the chart (read-only array; mutate items in place). */ readonly series: ReadonlyArray; /** Append a series; optional legend title. */ addSeries(title?: string): ChartSeries; /** Remove a series by handle or 0-based index. */ removeSeries(target: ChartSeries | number): void; /** Deep copy of this chart (not yet attached to another sheet). */ clone(): Chart; } export interface ChartsHost { markDirty(): void; readonly package: OpcPackage; readonly sheetPartName: string | undefined; /** Worksheet name for sheet-qualified series formulas. */ readonly sheetName?: string; /** 1-based row height in points; 0 = unset → placement default. */ getRowHeightPt?(row: number): number; /** 1-based column width in OOXML character units; 0 = unset. */ getColumnWidthChars?(column: number): number; } export interface ChartsMaterializeResult { readonly drawingRel: OpcRelationship | undefined; readonly drawingRelationshipId: string | undefined; readonly ownsDrawingElement: boolean; } interface FillModel { type: ChartFillTypeValue; foreColor?: string; transparency?: number; } interface LineModel { color?: string; weightPt?: number; } interface TextAreaModel { fontName?: string; size?: number; bold: boolean; italic: boolean; color?: string; } interface FrameModel { fill: FillModel; line: LineModel; } interface DataLabelsModel { isValue: boolean; isCategoryName: boolean; isSeriesName: boolean; isPercentage: boolean; position?: DataLabelPositionValue; textArea: TextAreaModel; } /** * Series payload for model storage and host serialize helpers. * `serieFormat` / `dataLabels` are optional on input; serialize paths call * {@link ensureSeriesFormat} so bare `{ title, values, categoryLabels }` is valid. */ interface SeriesModel { title?: string; categoryLabels?: string; values: string; /** Bubble-size formula (`c:bubbleSize/c:numRef/c:f`); bubble charts only. */ bubbleSizes?: string; /** Per-series 3-D bubble effect (`c:bubble3D`). */ bubbleSize3D?: boolean; explodePercent?: number; serieFormat?: FrameModel; dataLabels?: DataLabelsModel; } interface AxisModel { title?: string; visible: boolean; hasMajorGridLines: boolean; hasMinorGridLines: boolean; numberFormat?: string; minimumValue?: number; maximumValue?: number; majorTickMark: TickMarkTypeValue; minorTickMark: TickMarkTypeValue; line: LineModel; titleArea: TextAreaModel; } export declare class ChartsImpl { private readonly entries; private readonly handles; private host; private drawingPartName; private drawingRelId; private dirty; private nextId; private nextName; bindHost(host: ChartsHost): void; loadFromPackage(pkg: OpcPackage, sheetPartName: string | undefined): void; readonly charts: ReadonlyArray; /** * Add a chart with positional geometry and a data argument. * * @param type - Chart layout from {@link ChartType}. * @param row - Top-left row (1-based). * @param column - Top-left column (1-based; 1 = A). * @param width - Width in points. * @param height - Height in points. * @param data - A1 range string, category-label formula string(s), or * {@link ChartData} for ChartEx cached points / mixed fields. Pass `''` * to create an empty chart and add series with {@link Chart.addSeries}. * @param values - Values formula when `data` is category-label formula(s). */ add(type: ChartType, row: number, column: number, width: number, height: number, data: string | ReadonlyArray | ChartData, values?: string): Chart; private addChartEx; private addClassic; remove(target: Chart | number): void; materializeOnFlush(drawingRel: OpcRelationship | undefined): ChartsMaterializeResult; private entryNeedsRewrite; private materializeChartPartRels; private allocateChartExPart; private allocateDrawingPart; private allocateChartPart; private markDirty; private sheetName; private sheetMetrics; private handleFor; } interface ParsedChartSpace { type: ChartType; name?: string; chartTitle?: string; hasTitle: boolean; chartTitleArea: TextAreaModel; chartArea: FrameModel; plotArea: FrameModel; dataRange?: string; grouping?: BarGrouping | AreaGrouping; scatterStyle?: ScatterStyle; view3D?: ChartView3D; dataSource: ChartDataSource; series: SeriesModel[]; hasLegend: boolean; legendPosition: LegendPositionValue; legendTextArea: TextAreaModel; legendFrame: FrameModel; hasDataTable: boolean; categoryAxis: AxisModel; valueAxis: AxisModel; preservedChartXml?: string; } /** * One relationship the host must write into the chart part's `.rels` * (`chartN.xml.rels`) so `c:externalData/@r:id` resolves. */ export interface HostChartRelationship { /** Relationship Id — must match `dataSource.relationshipId` / `c:externalData/@r:id`. */ readonly id: string; /** Relationship type URI (package or oleObject for externalData). */ readonly type: string; /** * Target URI or package-relative path. * Omitted when the host must supply it (embedded part path unknown here). */ readonly target?: string; /** OPC TargetMode; `External` for external workbook links. */ readonly targetMode?: 'External' | 'Internal'; } /** * Chart part handoff for DocIO / PPTX (and other hosts). * Hosts place {@link ChartPartExport.xml} as `chartN.xml` and write * {@link ChartPartExport.relationships} into that part's `.rels`. */ export interface ChartPartExport { /** Full `c:chartSpace` document (`chartN.xml` body), including XML declaration. */ readonly xml: string; /** OPC content type for the chart part. */ readonly contentType: string; /** * Drawing → chart relationship type the host uses from its graphic frame * (`…/relationships/chart`). */ readonly chartRelationshipType: string; /** Suggested file name only (`chart{id}.xml`); host chooses the folder. */ readonly suggestedPartFileName: string; readonly chartId: number; readonly chartName: string; /** Current `c:externalData` model (kind + relationship id). */ readonly dataSource: ChartDataSource; /** * Relationships to write beside the chart part. * Empty when `dataSource.kind === 'none'`. */ readonly relationships: ReadonlyArray; } /** * Create options for a classic live chart handle that is **not** owned by a * worksheet (`createOfficeChart`). Word/PPT hosts own layout; dummy sheet * geometry is stamped only so the shared {@link Chart} model stays valid. * * Data follows the same shapes as {@link Worksheet.addChart}: a range string, * category-label formula(s) + values, or {@link ChartData}. Presentation and * `dataSource` are set on the returned handle after create (no create-time * `dataSource` bag). * * Does not register the chart on any worksheet and does not change XLSX sheet * chart lifecycle. */ export interface OfficeChartCreateOptions { /** Classic chart layout from {@link ChartType}. ChartEx types are rejected. */ readonly type: ChartType; /** * A1 range string, category-label formula string(s), or {@link ChartData}. * Pass `''` to create an empty chart and add series with {@link Chart.addSeries}. */ readonly data: string | ReadonlyArray | ChartData; /** Values formula when `data` is category-label formula(s). */ readonly values?: string; /** Optional chart name (default `Chart N`). */ readonly name?: string; /** Optional chart title text (also enables {@link Chart.hasTitle}). */ readonly chartTitle?: string; /** * Sheet name used when deriving series formulas from a bare A1 range. * Default `'Sheet1'`. Does not attach the chart to a worksheet. */ readonly sheetName?: string; } /** * Optional context when parsing a host `c:chartSpace` into a live chart handle * (`parseOfficeChart`). */ export interface ParseOfficeChartOptions { /** OPC package for resolving chart-part `c:externalData` relationships. */ readonly package?: OpcPackage; /** Chart part name used with {@link package} for relationship lookup. */ readonly chartPartName?: string; /** * Sheet name used when the handle later mutates `dataRange` / series formulas. * Default `'Sheet1'`. Does not attach the chart to a worksheet. */ readonly sheetName?: string; } /** * Create a classic live {@link Chart} handle that is **not** owned by a worksheet. * * For DocIO/PPTX hosts that need a mutable chart model + {@link exportChartPart} * without calling `sheet.addChart`. Does not push into any worksheet chart * collection and does not mark any sheet dirty — existing XLSX sheet behavior * is unchanged. * * ChartEx layouts are not supported in this phase (same policy as * {@link exportChartPart}). Bind {@link ChartDataSource} after create via the * host helpers on `@syncfusion/ej2-xlsx/internal/charts`. * * @param options - Type, data, and optional name/title/sheetName. * @returns Detached classic chart handle compatible with {@link exportChartPart}. * @throws {InvalidArgumentError} when options or data are invalid. * @throws {InvalidChartError} when the type is ChartEx or unknown. */ export declare function createOfficeChart(options: OfficeChartCreateOptions): Chart; /** * Parse a `c:chartSpace` XML document into a detached live {@link Chart} handle. * * Returns `undefined` when the XML is not a chartSpace (host should keep residual * bytes). Unknown classic plot structures still yield a handle with * `preservedChartXml` when {@link parseChartSpace} returns a placeholder entry. * Does not attach the chart to any worksheet — existing XLSX load/materialize * paths are unchanged. * * @param xml - Full chart part body (`chartN.xml`). * @param options - Optional package + part name for `c:externalData`, and sheetName. * @returns Detached chart handle, or `undefined` when unparseable as chartSpace. */ export declare function parseOfficeChart(xml: string, options?: ParseOfficeChartOptions): Chart | undefined; /** * Export serialized chart part XML + relationship descriptors for host packages. * * DocIO/PPTX call this instead of XLSX `materializeOnFlush`. They own the * drawing/frame and package paths; this library owns `c:chartSpace` XML and * reports the chart-part relationship intent for `c:externalData`. * * @param chart - Handle from `sheet.addChart` / `sheet.charts`, or from * {@link createOfficeChart} / {@link parseOfficeChart}. * @param options.embeddedTarget - Optional package-relative target for * `kind: 'embedded'` (e.g. `../embeddings/Microsoft_Excel_Worksheet1.xlsx`). * When omitted, the relationship still carries `id` + package type; host fills target. * @throws {InvalidArgumentError} when `chart` is not a library chart handle. * @throws {InvalidChartError} when the chart has no series or is ChartEx. */ export declare function exportChartPart(chart: Chart, options?: { embeddedTarget?: string; }): ChartPartExport; /** Serialize a minimal valid `c:chartSpace` (dml-chart.xsd). */ export declare function serializeChartSpace(entry: { type: ChartType; chartTitle?: string | undefined; hasTitle?: boolean; chartTitleArea?: TextAreaModel; chartArea?: FrameModel; plotArea?: FrameModel; grouping?: BarGrouping | AreaGrouping | undefined; scatterStyle?: ScatterStyle | undefined; view3D?: ChartView3D | undefined; dataSource: ChartDataSource; /** Series formulas; `serieFormat` / `dataLabels` optional (defaults applied). */ series: ReadonlyArray; hasLegend?: boolean; legendPosition?: LegendPositionValue; legendTextArea?: TextAreaModel; legendFrame?: FrameModel; hasDataTable?: boolean; categoryAxis?: AxisModel; valueAxis?: AxisModel; }): string; /** Parse chartSpace XML; classify externalData via chart-part relationships. */ export declare function parseChartSpace(xml: string, pkg: OpcPackage | undefined, chartPartName: string | undefined): ParsedChartSpace | undefined; export {};