@univerjs-pro/engine-chart 1.0.0-alpha.3 → 1.0.0-alpha.4
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/lib/cjs/facade.js +1 -0
- package/lib/cjs/index.js +1 -1
- package/lib/es/facade.js +1 -0
- package/lib/es/index.js +1 -1
- package/lib/facade.js +1 -0
- package/lib/index.js +1 -1
- package/lib/types/chart-builder/chart-builder-adapter.d.ts +13 -0
- package/lib/types/chart-builder/chart-builder.d.ts +35 -0
- package/lib/types/chart-builder/chart-description.d.ts +3 -0
- package/lib/types/chart-builder/chart-types.d.ts +459 -0
- package/lib/types/chart-builder/configuration/aggregation.d.ts +7 -0
- package/lib/types/chart-builder/configuration/appearance.d.ts +8 -0
- package/lib/types/chart-builder/configuration/area.d.ts +3 -0
- package/lib/types/chart-builder/configuration/axes.d.ts +26 -0
- package/lib/types/chart-builder/configuration/axis-pointer.d.ts +9 -0
- package/lib/types/chart-builder/configuration/bar.d.ts +3 -0
- package/lib/types/chart-builder/configuration/cartesian-series.d.ts +25 -0
- package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +40 -0
- package/lib/types/chart-builder/configuration/combination.d.ts +10 -0
- package/lib/types/chart-builder/configuration/funnel.d.ts +4 -0
- package/lib/types/chart-builder/configuration/heatmap.d.ts +9 -0
- package/lib/types/chart-builder/configuration/index.d.ts +29 -0
- package/lib/types/chart-builder/configuration/invalid-value.d.ts +3 -0
- package/lib/types/chart-builder/configuration/legend.d.ts +3 -0
- package/lib/types/chart-builder/configuration/line.d.ts +3 -0
- package/lib/types/chart-builder/configuration/mapping.d.ts +4 -0
- package/lib/types/chart-builder/configuration/mark-lines.d.ts +3 -0
- package/lib/types/chart-builder/configuration/palette.d.ts +4 -0
- package/lib/types/chart-builder/configuration/pareto.d.ts +7 -0
- package/lib/types/chart-builder/configuration/pie.d.ts +23 -0
- package/lib/types/chart-builder/configuration/point-mapping.d.ts +5 -0
- package/lib/types/chart-builder/configuration/radar.d.ts +5 -0
- package/lib/types/chart-builder/configuration/relation.d.ts +14 -0
- package/lib/types/chart-builder/configuration/subtitle.d.ts +3 -0
- package/lib/types/chart-builder/configuration/theme.d.ts +4 -0
- package/lib/types/chart-builder/configuration/title.d.ts +3 -0
- package/lib/types/chart-builder/configuration/trendline.d.ts +12 -0
- package/lib/types/chart-builder/configuration/waterfall.d.ts +12 -0
- package/lib/types/chart-builder/configuration/word-cloud.d.ts +7 -0
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +115 -0
- package/lib/types/chart-builder/conversion/chart-type-converter.d.ts +6 -0
- package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +11 -0
- package/lib/types/chart-builder/conversion/resolve-chart-model-data.d.ts +5 -0
- package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +19 -0
- package/lib/types/chart-builder/index.d.ts +12 -0
- package/lib/types/chart-builder/internal/deep-freeze.d.ts +1 -0
- package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +5 -0
- package/lib/types/chart-builder/internal/merge-description.d.ts +2 -0
- package/lib/types/enum.d.ts +28 -0
- package/lib/types/facade/builders/f-area-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-combination-chart-builder.d.ts +66 -0
- package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +61 -0
- package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +124 -0
- package/lib/types/facade/builders/f-line-chart-builder.d.ts +36 -0
- package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +112 -0
- package/lib/types/facade/builders/f-pie-chart-builder.d.ts +324 -0
- package/lib/types/facade/builders/f-radar-chart-builder.d.ts +62 -0
- package/lib/types/facade/builders/f-relation-chart-builder.d.ts +184 -0
- package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +33 -0
- package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +226 -0
- package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +91 -0
- package/lib/types/facade/builders/index.d.ts +13 -0
- package/lib/types/facade/chart-builder-registry.d.ts +8 -0
- package/lib/types/facade/chart-builder-type-map.d.ts +30 -0
- package/lib/types/facade/chart-host-builder-types.d.ts +21 -0
- package/lib/types/facade/f-axis-chart-builder.d.ts +245 -0
- package/lib/types/facade/f-cartesian-chart-builder.d.ts +146 -0
- package/lib/types/facade/f-chart-base.d.ts +82 -0
- package/lib/types/facade/f-chart-builder-base.d.ts +331 -0
- package/lib/types/facade/f-charts-base.d.ts +74 -0
- package/lib/types/facade/f-enum.d.ts +75 -0
- package/lib/types/facade/index.d.ts +16 -0
- package/lib/types/facade/internal/chart-builder-facade-context.d.ts +12 -0
- package/lib/types/facade/internal/constants.d.ts +2 -0
- package/lib/types/facade/internal/host-builder-composer.d.ts +16 -0
- package/lib/types/facade/register-builders.d.ts +1 -0
- package/lib/types/index.d.ts +10 -54
- package/lib/types/models/chart-host-style.d.ts +6 -1
- package/lib/types/models/chart-model.d.ts +141 -18
- package/lib/types/models/chart-resource-serializer.d.ts +10 -0
- package/lib/types/models/chart-semantic-axes.d.ts +4 -0
- package/lib/types/models/constants/default-chart-style.d.ts +21 -1
- package/lib/types/models/mode-converter/converters/waterfall-layout.d.ts +34 -0
- package/lib/types/models/mode-converter/render-spec-operators/mark-line.operator.d.ts +3 -0
- package/lib/types/models/mode-converter/render-spec-operators/tools.d.ts +2 -3
- package/lib/types/source/chart-data-item.d.ts +3 -0
- package/lib/types/types.d.ts +61 -2
- package/lib/types/util.d.ts +1 -3
- package/lib/types/utils/compact.d.ts +4 -0
- package/lib/umd/facade.js +1 -0
- package/lib/umd/index.js +1 -1
- package/package.json +14 -4
- package/lib/types/chart-model-api/chart-model-api.d.ts +0 -2
- package/lib/types/chart-model-api/chart-type-manifest.d.ts +0 -128
- package/lib/types/chart-model-api/chart-type-registry.d.ts +0 -56
- package/lib/types/chart-model-api/chart-type.d.ts +0 -7
- package/lib/types/chart-model-api/constants.d.ts +0 -99
- package/lib/types/chart-model-api/describe.d.ts +0 -3
- package/lib/types/chart-model-api/index.d.ts +0 -8
- package/lib/types/chart-model-api/patch-builder.d.ts +0 -9
- package/lib/types/chart-model-api/series-selector.d.ts +0 -3
- package/lib/types/chart-model-api/types.d.ts +0 -452
- package/lib/types/chart-model-api/utils.d.ts +0 -10
- package/lib/types/chart-model-api/validate.d.ts +0 -5
- package/lib/types/f-base-chart.d.ts +0 -25
|
@@ -0,0 +1,245 @@
|
|
|
1
|
+
import type { ChartAxisTarget, IChartAxisSpec, IChartMarkLineSpec } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import { FChartBuilderBase } from './f-chart-builder-base';
|
|
3
|
+
export declare abstract class FAxisChartBuilder extends FChartBuilderBase {
|
|
4
|
+
/**
|
|
5
|
+
* Replaces all fixed-axis mark lines.
|
|
6
|
+
*
|
|
7
|
+
* Omitted line-style fields use a 1 px solid stroke at full opacity and inherit the carrier
|
|
8
|
+
* series color, falling back to the active theme. Endpoint symbols are hidden. Labels are hidden
|
|
9
|
+
* unless a `label` object is supplied; an empty label object shows the axis-formatted value.
|
|
10
|
+
*
|
|
11
|
+
* Read the current value from `builder.describe().markLines`.
|
|
12
|
+
*
|
|
13
|
+
* @param lines The complete ordered mark-line collection. An empty list clears it.
|
|
14
|
+
* @returns This builder for chaining.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
18
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
19
|
+
* builder.setMarkLines([{ axis: univerAPI.Enum.ChartSemanticAxis.PrimaryValue, value: 80 }]);
|
|
20
|
+
* const markLines = builder.describe().markLines;
|
|
21
|
+
* ```
|
|
22
|
+
*/
|
|
23
|
+
setMarkLines(lines: readonly IChartMarkLineSpec[]): this;
|
|
24
|
+
/**
|
|
25
|
+
* Clears all fixed-axis mark lines.
|
|
26
|
+
*
|
|
27
|
+
* Read the cleared value from `builder.describe().markLines`.
|
|
28
|
+
*
|
|
29
|
+
* @returns This builder for chaining.
|
|
30
|
+
* @example
|
|
31
|
+
* ```ts
|
|
32
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
33
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
34
|
+
* builder.clearMarkLines();
|
|
35
|
+
* const markLines = builder.describe().markLines;
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
clearMarkLines(): this;
|
|
39
|
+
/**
|
|
40
|
+
* Sets the xaxis configuration and returns this builder for chaining.
|
|
41
|
+
*
|
|
42
|
+
* This method executes synchronously.
|
|
43
|
+
*
|
|
44
|
+
* @param value The semantic value to record.
|
|
45
|
+
* @returns This builder for chaining.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
49
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
50
|
+
* builder.setXAxis({ title: 'Month' });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
setXAxis(value: IChartAxisSpec): this;
|
|
54
|
+
/**
|
|
55
|
+
* Clears the xaxis configuration and returns this builder for chaining.
|
|
56
|
+
*
|
|
57
|
+
* This method executes synchronously.
|
|
58
|
+
*
|
|
59
|
+
* @param target The configuration field to clear or reset.
|
|
60
|
+
* @returns This builder for chaining.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
64
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
65
|
+
* builder.clearXAxis(univerAPI.Enum.ChartAxisTarget.Label);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
clearXAxis(target?: ChartAxisTarget): this;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the yaxis configuration and returns this builder for chaining.
|
|
71
|
+
*
|
|
72
|
+
* This method executes synchronously.
|
|
73
|
+
*
|
|
74
|
+
* @param value The semantic value to record.
|
|
75
|
+
* @returns This builder for chaining.
|
|
76
|
+
* @example
|
|
77
|
+
* ```ts
|
|
78
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
79
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
80
|
+
* builder.setYAxis({ title: 'Revenue' });
|
|
81
|
+
* ```
|
|
82
|
+
*/
|
|
83
|
+
setYAxis(value: IChartAxisSpec): this;
|
|
84
|
+
/**
|
|
85
|
+
* Clears the yaxis configuration and returns this builder for chaining.
|
|
86
|
+
*
|
|
87
|
+
* This method executes synchronously.
|
|
88
|
+
*
|
|
89
|
+
* @param target The configuration field to clear or reset.
|
|
90
|
+
* @returns This builder for chaining.
|
|
91
|
+
* @example
|
|
92
|
+
* ```ts
|
|
93
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
94
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
95
|
+
* builder.clearYAxis(univerAPI.Enum.ChartAxisTarget.GridLine);
|
|
96
|
+
* ```
|
|
97
|
+
*/
|
|
98
|
+
clearYAxis(target?: ChartAxisTarget): this;
|
|
99
|
+
/**
|
|
100
|
+
* Sets the right yaxis configuration and returns this builder for chaining.
|
|
101
|
+
*
|
|
102
|
+
* This method executes synchronously.
|
|
103
|
+
*
|
|
104
|
+
* @param value The semantic value to record.
|
|
105
|
+
* @returns This builder for chaining.
|
|
106
|
+
* @example
|
|
107
|
+
* ```ts
|
|
108
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
109
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
110
|
+
* builder.setRightYAxis({ title: 'Margin' });
|
|
111
|
+
* ```
|
|
112
|
+
*/
|
|
113
|
+
setRightYAxis(value: IChartAxisSpec): this;
|
|
114
|
+
/**
|
|
115
|
+
* Clears the right yaxis configuration and returns this builder for chaining.
|
|
116
|
+
*
|
|
117
|
+
* This method executes synchronously.
|
|
118
|
+
*
|
|
119
|
+
* @param target The configuration field to clear or reset.
|
|
120
|
+
* @returns This builder for chaining.
|
|
121
|
+
* @example
|
|
122
|
+
* ```ts
|
|
123
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
124
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
125
|
+
* builder.clearRightYAxis(univerAPI.Enum.ChartAxisTarget.Line);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
clearRightYAxis(target?: ChartAxisTarget): this;
|
|
129
|
+
/**
|
|
130
|
+
* Sets the xaxis title configuration and returns this builder for chaining.
|
|
131
|
+
*
|
|
132
|
+
* This method executes synchronously.
|
|
133
|
+
*
|
|
134
|
+
* @param value The semantic value to record.
|
|
135
|
+
* @returns This builder for chaining.
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
139
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
140
|
+
* builder.setXAxisTitle('Month');
|
|
141
|
+
* ```
|
|
142
|
+
*/
|
|
143
|
+
setXAxisTitle(value: string): this;
|
|
144
|
+
/**
|
|
145
|
+
* Clears the xaxis title configuration and returns this builder for chaining.
|
|
146
|
+
*
|
|
147
|
+
* This method executes synchronously.
|
|
148
|
+
*
|
|
149
|
+
* @returns This builder for chaining.
|
|
150
|
+
* @example
|
|
151
|
+
* ```ts
|
|
152
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
153
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
154
|
+
* builder.clearXAxisTitle();
|
|
155
|
+
* ```
|
|
156
|
+
*/
|
|
157
|
+
clearXAxisTitle(): this;
|
|
158
|
+
/**
|
|
159
|
+
* Sets the yaxis title configuration and returns this builder for chaining.
|
|
160
|
+
*
|
|
161
|
+
* This method executes synchronously.
|
|
162
|
+
*
|
|
163
|
+
* @param value The semantic value to record.
|
|
164
|
+
* @returns This builder for chaining.
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
168
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
169
|
+
* builder.setYAxisTitle('Revenue');
|
|
170
|
+
* ```
|
|
171
|
+
*/
|
|
172
|
+
setYAxisTitle(value: string): this;
|
|
173
|
+
/**
|
|
174
|
+
* Clears the yaxis title configuration and returns this builder for chaining.
|
|
175
|
+
*
|
|
176
|
+
* This method executes synchronously.
|
|
177
|
+
*
|
|
178
|
+
* @returns This builder for chaining.
|
|
179
|
+
* @example
|
|
180
|
+
* ```ts
|
|
181
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
182
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
183
|
+
* builder.clearYAxisTitle();
|
|
184
|
+
* ```
|
|
185
|
+
*/
|
|
186
|
+
clearYAxisTitle(): this;
|
|
187
|
+
/**
|
|
188
|
+
* Sets the right yaxis title configuration and returns this builder for chaining.
|
|
189
|
+
*
|
|
190
|
+
* This method executes synchronously.
|
|
191
|
+
*
|
|
192
|
+
* @param value The semantic value to record.
|
|
193
|
+
* @returns This builder for chaining.
|
|
194
|
+
* @example
|
|
195
|
+
* ```ts
|
|
196
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
197
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
198
|
+
* builder.setRightYAxisTitle('Margin');
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
201
|
+
setRightYAxisTitle(value: string): this;
|
|
202
|
+
/**
|
|
203
|
+
* Clears the right yaxis title configuration and returns this builder for chaining.
|
|
204
|
+
*
|
|
205
|
+
* This method executes synchronously.
|
|
206
|
+
*
|
|
207
|
+
* @returns This builder for chaining.
|
|
208
|
+
* @example
|
|
209
|
+
* ```ts
|
|
210
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
211
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
212
|
+
* builder.clearRightYAxisTitle();
|
|
213
|
+
* ```
|
|
214
|
+
*/
|
|
215
|
+
clearRightYAxisTitle(): this;
|
|
216
|
+
/**
|
|
217
|
+
* Sets the use date axis configuration and returns this builder for chaining.
|
|
218
|
+
*
|
|
219
|
+
* This method executes synchronously.
|
|
220
|
+
*
|
|
221
|
+
* @param value The semantic value to record.
|
|
222
|
+
* @returns This builder for chaining.
|
|
223
|
+
* @example
|
|
224
|
+
* ```ts
|
|
225
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
226
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
227
|
+
* builder.setUseDateAxis(true);
|
|
228
|
+
* ```
|
|
229
|
+
*/
|
|
230
|
+
setUseDateAxis(value: boolean): this;
|
|
231
|
+
/**
|
|
232
|
+
* Restores the default of using a category axis instead of a date axis and returns this builder for chaining.
|
|
233
|
+
*
|
|
234
|
+
* This method executes synchronously.
|
|
235
|
+
*
|
|
236
|
+
* @returns This builder for chaining.
|
|
237
|
+
* @example
|
|
238
|
+
* ```ts
|
|
239
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
240
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
241
|
+
* builder.resetUseDateAxis();
|
|
242
|
+
* ```
|
|
243
|
+
*/
|
|
244
|
+
resetUseDateAxis(): this;
|
|
245
|
+
}
|
|
@@ -0,0 +1,146 @@
|
|
|
1
|
+
import type { ChartAllSeriesStyleTarget, ChartAxisPointerTarget, ChartPublicSeriesSelector, ChartSeriesClearTarget, ChartSeriesTrendlineSelector, ChartTrendlineSelector, ChartTrendlineValue, IChartAxisPointerSpec, IChartBarSpec, IChartSeriesPatch, IChartSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import { FAxisChartBuilder } from './f-axis-chart-builder';
|
|
3
|
+
export declare class FCartesianChartBuilder<TSeriesPatch extends Omit<IChartSeriesPatch, 'selector'> = Omit<IChartSeriesPatch, 'selector'>> extends FAxisChartBuilder {
|
|
4
|
+
readonly __seriesPatchType?: TSeriesPatch;
|
|
5
|
+
setBar(value: IChartBarSpec): this;
|
|
6
|
+
clearBar(): this;
|
|
7
|
+
/**
|
|
8
|
+
* Sets the series configuration and returns this builder for chaining.
|
|
9
|
+
*
|
|
10
|
+
* This method executes synchronously.
|
|
11
|
+
*
|
|
12
|
+
* @param selector The target series selector.
|
|
13
|
+
* @param patch The semantic configuration patch owned by this method.
|
|
14
|
+
* @returns This builder for chaining.
|
|
15
|
+
* @example
|
|
16
|
+
* ```ts
|
|
17
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
18
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
19
|
+
* builder.setSeries(0, { color: '#1677ff' });
|
|
20
|
+
* ```
|
|
21
|
+
*/
|
|
22
|
+
setSeries(selector: ChartPublicSeriesSelector, patch: TSeriesPatch): this;
|
|
23
|
+
/**
|
|
24
|
+
* Clears the series configuration and returns this builder for chaining.
|
|
25
|
+
*
|
|
26
|
+
* This method executes synchronously.
|
|
27
|
+
*
|
|
28
|
+
* @param selector The target series selector.
|
|
29
|
+
* @param target The configuration field to clear or reset.
|
|
30
|
+
* @returns This builder for chaining.
|
|
31
|
+
* @example
|
|
32
|
+
* ```ts
|
|
33
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
34
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
35
|
+
* builder.clearSeries(0);
|
|
36
|
+
* ```
|
|
37
|
+
*/
|
|
38
|
+
clearSeries(selector: ChartPublicSeriesSelector, target?: ChartSeriesClearTarget): this;
|
|
39
|
+
/**
|
|
40
|
+
* Sets persistent defaults inherited by every current and future series.
|
|
41
|
+
*
|
|
42
|
+
* This method executes synchronously.
|
|
43
|
+
*
|
|
44
|
+
* @param style The global series style defaults.
|
|
45
|
+
* @returns This builder for chaining.
|
|
46
|
+
* @example
|
|
47
|
+
* ```ts
|
|
48
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
49
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
50
|
+
* builder.setAllSeriesStyle({ color: '#1677ff', fillOpacity: 0.8 });
|
|
51
|
+
* ```
|
|
52
|
+
*/
|
|
53
|
+
setAllSeriesStyle(style: IChartSeriesStyleSpec): this;
|
|
54
|
+
/**
|
|
55
|
+
* Clears persistent defaults inherited by every series.
|
|
56
|
+
*
|
|
57
|
+
* This method executes synchronously.
|
|
58
|
+
*
|
|
59
|
+
* @param target The global series style field to clear, or omit it to clear all defaults.
|
|
60
|
+
* @returns This builder for chaining.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
64
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
65
|
+
* builder.clearAllSeriesStyle(univerAPI.Enum.ChartAllSeriesStyleTarget.Color);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
clearAllSeriesStyle(target?: ChartAllSeriesStyleTarget): this;
|
|
69
|
+
/**
|
|
70
|
+
* Sets the trendline configuration and returns this builder for chaining.
|
|
71
|
+
*
|
|
72
|
+
* This method executes synchronously.
|
|
73
|
+
*
|
|
74
|
+
* @param selector The target series selector.
|
|
75
|
+
* @param value The semantic value to record.
|
|
76
|
+
* @returns This builder for chaining.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
80
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
81
|
+
* builder.setTrendline(0, { type: univerAPI.Enum.ChartTrendlineType.linear });
|
|
82
|
+
* ```
|
|
83
|
+
*/
|
|
84
|
+
setTrendline(selector: ChartSeriesTrendlineSelector, value: ChartTrendlineValue): this;
|
|
85
|
+
/**
|
|
86
|
+
* Remove trendline.
|
|
87
|
+
*
|
|
88
|
+
* This method executes synchronously.
|
|
89
|
+
*
|
|
90
|
+
* @param selector The target series selector.
|
|
91
|
+
* @param trendline The trendline configuration to append.
|
|
92
|
+
* @returns This builder for chaining.
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
96
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
97
|
+
* builder.removeTrendline(0, 0);
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
100
|
+
removeTrendline(selector: ChartSeriesTrendlineSelector, trendline: ChartTrendlineSelector): this;
|
|
101
|
+
/**
|
|
102
|
+
* Clears the trendlines configuration and returns this builder for chaining.
|
|
103
|
+
*
|
|
104
|
+
* This method executes synchronously.
|
|
105
|
+
*
|
|
106
|
+
* @param selector The target series selector.
|
|
107
|
+
* @returns This builder for chaining.
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
111
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
112
|
+
* builder.clearTrendlines(0);
|
|
113
|
+
* ```
|
|
114
|
+
*/
|
|
115
|
+
clearTrendlines(selector?: ChartSeriesTrendlineSelector): this;
|
|
116
|
+
/**
|
|
117
|
+
* Sets the axis pointer configuration and returns this builder for chaining.
|
|
118
|
+
*
|
|
119
|
+
* This method executes synchronously.
|
|
120
|
+
*
|
|
121
|
+
* @param value The semantic value to record.
|
|
122
|
+
* @returns This builder for chaining.
|
|
123
|
+
* @example
|
|
124
|
+
* ```ts
|
|
125
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
126
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
127
|
+
* builder.setAxisPointer({ indicatorLineColor: '#1677ff' });
|
|
128
|
+
* ```
|
|
129
|
+
*/
|
|
130
|
+
setAxisPointer(value: IChartAxisPointerSpec): this;
|
|
131
|
+
/**
|
|
132
|
+
* Clears the axis pointer configuration and returns this builder for chaining.
|
|
133
|
+
*
|
|
134
|
+
* This method executes synchronously.
|
|
135
|
+
*
|
|
136
|
+
* @param target The configuration field to clear or reset.
|
|
137
|
+
* @returns This builder for chaining.
|
|
138
|
+
* @example
|
|
139
|
+
* ```ts
|
|
140
|
+
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
141
|
+
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Line);
|
|
142
|
+
* builder.clearAxisPointer(univerAPI.Enum.ChartAxisPointerTarget.IndicatorLineColor);
|
|
143
|
+
* ```
|
|
144
|
+
*/
|
|
145
|
+
clearAxisPointer(target?: ChartAxisPointerTarget): this;
|
|
146
|
+
}
|
|
@@ -0,0 +1,82 @@
|
|
|
1
|
+
import type { ChartBuilder, ChartDescription, IChartRenderModelImageExportOptions, IChartRenderModelImageExportResult, IResolvedChartData } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { DeepReadonly } from '@univerjs/core';
|
|
3
|
+
import type { IChartBuilderFacadeContext, IChartBuilderFacadeContextAccess } from './internal/chart-builder-facade-context';
|
|
4
|
+
export declare abstract class FChartBase<TDescription extends ChartDescription = ChartDescription, TBuilder extends ChartBuilder = ChartBuilder> implements IChartBuilderFacadeContextAccess {
|
|
5
|
+
protected readonly _context: IChartBuilderFacadeContext<TBuilder>;
|
|
6
|
+
protected readonly _builder: TBuilder;
|
|
7
|
+
constructor(_context: IChartBuilderFacadeContext<TBuilder>);
|
|
8
|
+
/**
|
|
9
|
+
* Returns the current id value.
|
|
10
|
+
*
|
|
11
|
+
* This method executes synchronously.
|
|
12
|
+
*
|
|
13
|
+
* @returns The host-owned chart ID.
|
|
14
|
+
* @example
|
|
15
|
+
* ```ts
|
|
16
|
+
* const chart = univerAPI.getActiveWorkbook().getActiveSheet().charts.list()[0];
|
|
17
|
+
* chart.getId();
|
|
18
|
+
* ```
|
|
19
|
+
*/
|
|
20
|
+
getId(): string;
|
|
21
|
+
/**
|
|
22
|
+
* Returns a detached read-only description including pending builder changes.
|
|
23
|
+
*
|
|
24
|
+
* This method executes synchronously.
|
|
25
|
+
*
|
|
26
|
+
* @returns An immutable description including pending builder changes.
|
|
27
|
+
* @example
|
|
28
|
+
* ```ts
|
|
29
|
+
* const chart = univerAPI.getActiveWorkbook().getActiveSheet().charts.list()[0];
|
|
30
|
+
* chart.describe();
|
|
31
|
+
* ```
|
|
32
|
+
*/
|
|
33
|
+
describe(): DeepReadonly<TDescription>;
|
|
34
|
+
/**
|
|
35
|
+
* Resolves fresh, read-only chart data from the latest host data and pending builder changes.
|
|
36
|
+
*
|
|
37
|
+
* This method executes synchronously and does not commit pending changes. It is available
|
|
38
|
+
* only after the builder is hosted; for a newly created builder, call it on the value returned
|
|
39
|
+
* by `charts.insert(builder)`.
|
|
40
|
+
*
|
|
41
|
+
* @returns Fresh immutable category and series data for the effective chart configuration.
|
|
42
|
+
* @throws If the builder has not been inserted into a host.
|
|
43
|
+
* @example
|
|
44
|
+
* ```ts
|
|
45
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
46
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
47
|
+
* if (!fWorksheet) return;
|
|
48
|
+
* const chart = fWorksheet.charts.list()[0];
|
|
49
|
+
* chart.setValueFields([1, 2]);
|
|
50
|
+
* const data = chart.resolveData();
|
|
51
|
+
* console.log(data.series);
|
|
52
|
+
* ```
|
|
53
|
+
*/
|
|
54
|
+
resolveData(): DeepReadonly<IResolvedChartData>;
|
|
55
|
+
/**
|
|
56
|
+
* Commits all pending builder changes synchronously.
|
|
57
|
+
*
|
|
58
|
+
* This method executes synchronously.
|
|
59
|
+
*
|
|
60
|
+
* @returns This builder for chaining.
|
|
61
|
+
* @example
|
|
62
|
+
* ```ts
|
|
63
|
+
* const chart = univerAPI.getActiveWorkbook().getActiveSheet().charts.list()[0];
|
|
64
|
+
* chart.commit();
|
|
65
|
+
* ```
|
|
66
|
+
*/
|
|
67
|
+
commit(): this;
|
|
68
|
+
/**
|
|
69
|
+
* Renders the current chart as an image.
|
|
70
|
+
*
|
|
71
|
+
* This method completes asynchronously.
|
|
72
|
+
*
|
|
73
|
+
* @param options The image export options.
|
|
74
|
+
* @returns A promise resolving to the exported image, or null when unavailable.
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* const chart = univerAPI.getActiveWorkbook().getActiveSheet().charts.list()[0];
|
|
78
|
+
* const image = await chart.exportImage({ pixelRatio: 2 });
|
|
79
|
+
* ```
|
|
80
|
+
*/
|
|
81
|
+
exportImage(options?: IChartRenderModelImageExportOptions): Promise<IChartRenderModelImageExportResult | null>;
|
|
82
|
+
}
|