Skip to content

Commit 3074295

Browse files
committed
chore: optimize Chart.ts file & tweak example18
1 parent bbdb281 commit 3074295

File tree

3 files changed

+200
-213
lines changed

3 files changed

+200
-213
lines changed

packages/demo/src/examples/example18.html

Lines changed: 2 additions & 28 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<div class="row">
33
<div class="col-md-12 title-desc">
44
<h2 class="bd-title">
5-
Example 18: Create Chart
5+
Example 18: Create Charts
66
<span class="float-end links">
77
Code <span class="fa fa-link"></span>
88
<span class="small">
@@ -29,37 +29,11 @@ <h2 class="bd-title">
2929
<div class="mb-2">
3030
<button id="export-chart" class="btn btn-success btn-sm">
3131
<i class="fa fa-download"></i>
32-
Excel Export with Chart
32+
Excel Export
3333
</button>
3434
</div>
3535
<div class="row">
3636
<div class="table-container col-sm-6">
37-
<table class="table">
38-
<thead>
39-
<tr>
40-
<th scope="col">Month</th>
41-
<th scope="col">Q1</th>
42-
<th scope="col">Q2</th>
43-
</tr>
44-
</thead>
45-
<tbody>
46-
<tr>
47-
<td>Jan</td>
48-
<td>120</td>
49-
<td>180</td>
50-
</tr>
51-
<tr>
52-
<td>Feb</td>
53-
<td>150</td>
54-
<td>160</td>
55-
</tr>
56-
<tr>
57-
<td>Mar</td>
58-
<td>170</td>
59-
<td>200</td>
60-
</tr>
61-
</tbody>
62-
</table>
6337
<div class="screenshot-wrapper mt-4">
6438
<h6 class="mb-2">Excel Preview (single sheet example)</h6>
6539
<p class="small text-muted mt-1">

packages/excel-builder-vanilla-types/dist/index.d.ts

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -437,29 +437,33 @@ export declare class Chart extends Drawing {
437437
target: string | null;
438438
options: ChartOptions;
439439
constructor(options: ChartOptions);
440-
/** RelationshipManager calls this via Drawings */
441-
setRelationshipId(rId: string): void;
442440
/** Return relationship type for this drawing */
443441
getMediaType(): keyof typeof Util.schemas;
444-
/** Creates the graphicFrame container that goes inside an anchor in drawing part */
445-
private createGraphicFrame;
442+
/** RelationshipManager calls this via Drawings */
443+
setRelationshipId(rId: string): void;
446444
/** Drawing part representation (inside an anchor) */
447445
toXML(xmlDoc: XMLDOM): XMLNode;
448-
private _nextAxisIdBase;
449446
/** Chart part XML: /xl/charts/chartN.xml */
450447
toChartSpaceXML(): XMLDOM;
448+
/** Creates the graphicFrame container that goes inside an anchor in drawing part */
449+
private createGraphicFrame;
451450
/** Create the primary chart node based on type and stacking */
452451
private _createPrimaryChartNode;
453-
/** Resolve grouping value based on chart type and stacking */
454-
private _resolveGrouping;
452+
/** Build a <c:ser> node */
453+
private _createSeriesNode;
454+
/** Apply a basic series color if provided. Supports RGB (RRGGBB) or ARGB (AARRGGBB); leading # optional. Alpha (if provided) is stripped. */
455+
private _applySeriesColor;
456+
/** Create legend node honoring position + overlay */
457+
private _createLegendNode;
455458
/** Create a c:title node with minimal rich text required for Excel to render */
456459
private _createTitleNode;
457460
/** Create a category axis (catAx) */
458461
private _createCategoryAxis;
459462
/** Create a value axis (valAx) */
460463
private _createValueAxis;
461-
/** Apply a basic series color if provided. Supports RGB (RRGGBB) or ARGB (AARRGGBB); leading # optional. Alpha (if provided) is stripped. */
462-
private _applySeriesColor;
464+
private _nextAxisIdBase;
465+
/** Resolve grouping value based on chart type and stacking */
466+
private _resolveGrouping;
463467
}
464468
export type Relation = {
465469
[id: string]: {

0 commit comments

Comments
 (0)