@univerjs-pro/sheets-chart 1.0.0-rc.0 → 1.0.0
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 -1
- package/lib/cjs/index.js +1 -1
- package/lib/cjs/locale/ar-SA.js +1 -1
- package/lib/cjs/locale/ca-ES.js +1 -1
- package/lib/cjs/locale/de-DE.js +1 -1
- package/lib/cjs/locale/en-US.js +1 -1
- package/lib/cjs/locale/es-ES.js +1 -1
- package/lib/cjs/locale/fa-IR.js +1 -1
- package/lib/cjs/locale/fr-FR.js +1 -1
- package/lib/cjs/locale/id-ID.js +1 -1
- package/lib/cjs/locale/it-IT.js +1 -1
- package/lib/cjs/locale/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.js +1 -1
- package/lib/cjs/locale/pl-PL.js +1 -1
- package/lib/cjs/locale/pt-BR.js +1 -1
- package/lib/cjs/locale/ru-RU.js +1 -1
- package/lib/cjs/locale/sk-SK.js +1 -1
- package/lib/cjs/locale/vi-VN.js +1 -1
- package/lib/cjs/locale/zh-CN.js +1 -1
- package/lib/cjs/locale/zh-HK.js +1 -1
- package/lib/cjs/locale/zh-TW.js +1 -1
- package/lib/es/facade.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ar-SA.js +1 -1
- package/lib/es/locale/ca-ES.js +1 -1
- package/lib/es/locale/de-DE.js +1 -1
- package/lib/es/locale/en-US.js +1 -1
- package/lib/es/locale/es-ES.js +1 -1
- package/lib/es/locale/fa-IR.js +1 -1
- package/lib/es/locale/fr-FR.js +1 -1
- package/lib/es/locale/id-ID.js +1 -1
- package/lib/es/locale/it-IT.js +1 -1
- package/lib/es/locale/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.js +1 -1
- package/lib/es/locale/pl-PL.js +1 -1
- package/lib/es/locale/pt-BR.js +1 -1
- package/lib/es/locale/ru-RU.js +1 -1
- package/lib/es/locale/sk-SK.js +1 -1
- package/lib/es/locale/vi-VN.js +1 -1
- package/lib/es/locale/zh-CN.js +1 -1
- package/lib/es/locale/zh-HK.js +1 -1
- package/lib/es/locale/zh-TW.js +1 -1
- package/lib/facade.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ar-SA.js +1 -1
- package/lib/locale/ca-ES.js +1 -1
- package/lib/locale/de-DE.js +1 -1
- package/lib/locale/en-US.js +1 -1
- package/lib/locale/es-ES.js +1 -1
- package/lib/locale/fa-IR.js +1 -1
- package/lib/locale/fr-FR.js +1 -1
- package/lib/locale/id-ID.js +1 -1
- package/lib/locale/it-IT.js +1 -1
- package/lib/locale/ja-JP.js +1 -1
- package/lib/locale/ko-KR.js +1 -1
- package/lib/locale/pl-PL.js +1 -1
- package/lib/locale/pt-BR.js +1 -1
- package/lib/locale/ru-RU.js +1 -1
- package/lib/locale/sk-SK.js +1 -1
- package/lib/locale/vi-VN.js +1 -1
- package/lib/locale/zh-CN.js +1 -1
- package/lib/locale/zh-HK.js +1 -1
- package/lib/locale/zh-TW.js +1 -1
- package/lib/types/chart-builder/sheet-chart-config-adapter.d.ts +3 -0
- package/lib/types/chart-source/category-span-projection.d.ts +1 -0
- package/lib/types/chart-source/chart-source-key.d.ts +1 -1
- package/lib/types/chart-source/chart-source.d.ts +5 -3
- package/lib/types/chart-source/initial-sheet-chart-source-inference.d.ts +2 -1
- package/lib/types/chart-source/sheet-chart-source-table.d.ts +4 -1
- package/lib/types/commands/chart-persisted-context.d.ts +1 -1
- package/lib/types/commands/commands/sheets-chart.command.d.ts +9 -1
- package/lib/types/common/util.d.ts +0 -1
- package/lib/types/controllers/config.schema.d.ts +5 -0
- package/lib/types/facade/chart-builder/builder-util.d.ts +5 -0
- package/lib/types/facade/chart-builder/chart-builder-base.d.ts +919 -0
- package/lib/types/facade/chart-builder/line-chart-builder.d.ts +165 -0
- package/lib/types/facade/chart-builder/pie-chart-builder.d.ts +196 -0
- package/lib/types/facade/chart-builder/radar-chart-builder.d.ts +100 -0
- package/lib/types/facade/chart-builder/types.d.ts +34 -0
- package/lib/types/index.d.ts +2 -2
- package/lib/types/models/chart-model.d.ts +22 -0
- package/lib/types/services/sheet-chart-data-source-manager.d.ts +1 -1
- package/lib/types/services/sheets-chart.service.d.ts +2 -1
- package/lib/umd/facade.js +1 -1
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ar-SA.js +1 -1
- package/lib/umd/locale/ca-ES.js +1 -1
- package/lib/umd/locale/de-DE.js +1 -1
- package/lib/umd/locale/en-US.js +1 -1
- package/lib/umd/locale/es-ES.js +1 -1
- package/lib/umd/locale/fa-IR.js +1 -1
- package/lib/umd/locale/fr-FR.js +1 -1
- package/lib/umd/locale/id-ID.js +1 -1
- package/lib/umd/locale/it-IT.js +1 -1
- package/lib/umd/locale/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.js +1 -1
- package/lib/umd/locale/pl-PL.js +1 -1
- package/lib/umd/locale/pt-BR.js +1 -1
- package/lib/umd/locale/ru-RU.js +1 -1
- package/lib/umd/locale/sk-SK.js +1 -1
- package/lib/umd/locale/vi-VN.js +1 -1
- package/lib/umd/locale/zh-CN.js +1 -1
- package/lib/umd/locale/zh-HK.js +1 -1
- package/lib/umd/locale/zh-TW.js +1 -1
- package/package.json +11 -11
|
@@ -0,0 +1,165 @@
|
|
|
1
|
+
import type { AreaLineStyle, LinePointShape } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { Injector, Workbook } from '@univerjs/core';
|
|
3
|
+
import type { IChartBuilderInfo } from './chart-builder-base';
|
|
4
|
+
import { FChartBuilderBase } from './chart-builder-base';
|
|
5
|
+
/**
|
|
6
|
+
* The builder for creating a line chart.
|
|
7
|
+
* @hideconstructor
|
|
8
|
+
*/
|
|
9
|
+
export declare class LineChartBuilder extends FChartBuilderBase {
|
|
10
|
+
/**
|
|
11
|
+
* @property {AreaLineStyle} lineStyle The line style of the line chart.
|
|
12
|
+
*/
|
|
13
|
+
lineStyle: AreaLineStyle;
|
|
14
|
+
/**
|
|
15
|
+
* @property {LinePointShape} dataPointShape The shape of the data point in the line chart.
|
|
16
|
+
*/
|
|
17
|
+
dataPointShape: LinePointShape;
|
|
18
|
+
/**
|
|
19
|
+
* @property {string} dataPointColor The color of the data point in the line chart.
|
|
20
|
+
*/
|
|
21
|
+
dataPointColor: string;
|
|
22
|
+
/**
|
|
23
|
+
* @property {number} dataPointSize The size of the data point in the line chart.
|
|
24
|
+
*/
|
|
25
|
+
dataPointSize: number;
|
|
26
|
+
constructor(unitId: string, subUnitId: string, workbook: Workbook, injector: Injector, chartId?: string);
|
|
27
|
+
/**
|
|
28
|
+
* The line style of the area chart.
|
|
29
|
+
* @param {AreaLineStyle} lineStyle The line style of the line chart.
|
|
30
|
+
* @returns {LineChartBuilder} - The builder, for chaining.
|
|
31
|
+
*
|
|
32
|
+
* @example
|
|
33
|
+
* ```ts
|
|
34
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
35
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
36
|
+
* if (!fWorksheet) return;
|
|
37
|
+
*
|
|
38
|
+
* // Create a line chart builder with data source A1:D6.
|
|
39
|
+
* // The starting position is upper-left corner of cell B2.
|
|
40
|
+
* // The line style is set to the step type.
|
|
41
|
+
* const chartInfo = fWorksheet.newChart()
|
|
42
|
+
* .asLineChart()
|
|
43
|
+
* .addRange('A1:D6')
|
|
44
|
+
* .setPosition(1, 1, 0, 0)
|
|
45
|
+
* .setLineStyle('step')
|
|
46
|
+
* .build();
|
|
47
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
48
|
+
* ```
|
|
49
|
+
*/
|
|
50
|
+
setLineStyle(lineStyle: AreaLineStyle): this;
|
|
51
|
+
/**
|
|
52
|
+
* The shape of the data point in the line chart.
|
|
53
|
+
* @param {LinePointShape} dataPointShape The shape of the data point in the line chart.
|
|
54
|
+
* @returns {LineChartBuilder} - The builder, for chaining.
|
|
55
|
+
*
|
|
56
|
+
* @example
|
|
57
|
+
* ```ts
|
|
58
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
59
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
60
|
+
* if (!fWorksheet) return;
|
|
61
|
+
*
|
|
62
|
+
* // Create a line chart with data source A1:D6.
|
|
63
|
+
* // The starting position is upper-left corner of cell B2.
|
|
64
|
+
* // The data point shape is set to circle, color is red, and size is 10.
|
|
65
|
+
* const chartInfo = fWorksheet.newChart()
|
|
66
|
+
* .asLineChart()
|
|
67
|
+
* .addRange('A1:D6')
|
|
68
|
+
* .setPosition(1, 1, 0, 0)
|
|
69
|
+
* .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
|
|
70
|
+
* .setDataPointColor('#ff0000')
|
|
71
|
+
* .setDataPointSize(10)
|
|
72
|
+
* .build();
|
|
73
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
setDataPointShape(dataPointShape: LinePointShape): this;
|
|
77
|
+
/**
|
|
78
|
+
* The color of the data point in the line chart.
|
|
79
|
+
* @param {string} dataPointColor The color of the data point in the line chart.
|
|
80
|
+
* @returns {LineChartBuilder} The builder, for chaining.
|
|
81
|
+
*
|
|
82
|
+
* @example
|
|
83
|
+
* ```ts
|
|
84
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
85
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
86
|
+
* if (!fWorksheet) return;
|
|
87
|
+
*
|
|
88
|
+
* // Create a line chart with data source A1:D6.
|
|
89
|
+
* // The starting position is upper-left corner of cell B2.
|
|
90
|
+
* // The data point shape is set to circle, color is red, and size is 10.
|
|
91
|
+
* const chartInfo = fWorksheet.newChart()
|
|
92
|
+
* .asLineChart()
|
|
93
|
+
* .addRange('A1:D6')
|
|
94
|
+
* .setPosition(1, 1, 0, 0)
|
|
95
|
+
* .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
|
|
96
|
+
* .setDataPointColor('#ff0000')
|
|
97
|
+
* .setDataPointSize(10)
|
|
98
|
+
* .build();
|
|
99
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
100
|
+
* ```
|
|
101
|
+
*/
|
|
102
|
+
setDataPointColor(dataPointColor: string): this;
|
|
103
|
+
/**
|
|
104
|
+
* The size of the data point in the line chart.
|
|
105
|
+
* @param {number} dataPointSize The size of the data point in the line chart.
|
|
106
|
+
* @returns {LineChartBuilder} The builder, for chaining.
|
|
107
|
+
*
|
|
108
|
+
* @example
|
|
109
|
+
* ```ts
|
|
110
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
111
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
112
|
+
* if (!fWorksheet) return;
|
|
113
|
+
*
|
|
114
|
+
* // Create a line chart with data source A1:D6.
|
|
115
|
+
* // The starting position is upper-left corner of cell B2.
|
|
116
|
+
* // The data point shape is set to circle, color is red, and size is 10.
|
|
117
|
+
* const chartInfo = fWorksheet.newChart()
|
|
118
|
+
* .asLineChart()
|
|
119
|
+
* .addRange('A1:D6')
|
|
120
|
+
* .setPosition(1, 1, 0, 0)
|
|
121
|
+
* .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
|
|
122
|
+
* .setDataPointColor('#ff0000')
|
|
123
|
+
* .setDataPointSize(10)
|
|
124
|
+
* .build();
|
|
125
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
126
|
+
* ```
|
|
127
|
+
*/
|
|
128
|
+
setDataPointSize(dataPointSize: number): this;
|
|
129
|
+
/**
|
|
130
|
+
* Builds the chart to reflect all changes made to it.
|
|
131
|
+
* @description This method does not automatically draw the chart on top of the spreadsheet. A new chart must be inserted via sheet.insertChart(chart), and an existing chart should be updated via sheet.updateChart(chart).
|
|
132
|
+
* @returns {IChartBuilderInfo} The chart builder info.
|
|
133
|
+
*
|
|
134
|
+
* @example
|
|
135
|
+
* ```ts
|
|
136
|
+
* @example
|
|
137
|
+
* ```ts
|
|
138
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
139
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
140
|
+
* if (!fWorksheet) return;
|
|
141
|
+
*
|
|
142
|
+
* // Create a line chart with data source A1:D6.
|
|
143
|
+
* // The starting position is upper-left corner of cell B2.
|
|
144
|
+
* // The line style is set to the step type.
|
|
145
|
+
* // The data point shape is set to circle, color is red, and size is 10.
|
|
146
|
+
* const chartInfo = fWorksheet.newChart()
|
|
147
|
+
* .asLineChart()
|
|
148
|
+
* .addRange('A1:D6')
|
|
149
|
+
* .setPosition(1, 1, 0, 0)
|
|
150
|
+
* .setLineStyle('step')
|
|
151
|
+
* .setDataPointShape(univerAPI.Enum.LinePointShape.Circle)
|
|
152
|
+
* .setDataPointColor('#ff0000')
|
|
153
|
+
* .setDataPointSize(10)
|
|
154
|
+
* .build();
|
|
155
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
156
|
+
* ```
|
|
157
|
+
*/
|
|
158
|
+
build(): IChartBuilderInfo;
|
|
159
|
+
}
|
|
160
|
+
/**
|
|
161
|
+
* @ignore
|
|
162
|
+
*/
|
|
163
|
+
export declare class LineChartBuilderMixin extends FChartBuilderBase {
|
|
164
|
+
asLineChart(): LineChartBuilder;
|
|
165
|
+
}
|
|
@@ -0,0 +1,196 @@
|
|
|
1
|
+
import type { Injector, Workbook } from '@univerjs/core';
|
|
2
|
+
import type { IChartBuilderInfo } from './chart-builder-base';
|
|
3
|
+
import { FChartBuilderBase } from './chart-builder-base';
|
|
4
|
+
/**
|
|
5
|
+
* The builder for creating a pie chart.
|
|
6
|
+
* @hideconstructor
|
|
7
|
+
*/
|
|
8
|
+
export declare class PieChartBuilder extends FChartBuilderBase {
|
|
9
|
+
doughnutHole: number;
|
|
10
|
+
borderColor: string;
|
|
11
|
+
hasPaddingAngle: boolean;
|
|
12
|
+
isHalfPie: boolean;
|
|
13
|
+
rosePie: boolean;
|
|
14
|
+
showLabelLine: boolean;
|
|
15
|
+
constructor(unitId: string, subUnitId: string, workbook: Workbook, injector: Injector, chartId?: string);
|
|
16
|
+
/**
|
|
17
|
+
* Sets the size of the hole in the center of the pie chart as a percentage of the chart size.The value should be in the range 0-1.
|
|
18
|
+
* @param {number} doughnutHole The size of the hole in the center of the pie chart as a percentage of the chart size.
|
|
19
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
20
|
+
*
|
|
21
|
+
* @example
|
|
22
|
+
* ```ts
|
|
23
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
24
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
25
|
+
* if (!fWorksheet) return;
|
|
26
|
+
*
|
|
27
|
+
* // Create a pie chart with data source A1:D6.
|
|
28
|
+
* // The starting position is upper-left corner of cell B2.
|
|
29
|
+
* // The doughnut hole is set to 0.5.
|
|
30
|
+
* const chartInfo = fWorksheet.newChart()
|
|
31
|
+
* .asPieChart()
|
|
32
|
+
* .addRange('A1:D6')
|
|
33
|
+
* .setPosition(1, 1, 0, 0)
|
|
34
|
+
* .setDoughnutHole(0.5)
|
|
35
|
+
* .build();
|
|
36
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
37
|
+
* ```
|
|
38
|
+
*/
|
|
39
|
+
setDoughnutHole(doughnutHole: number): this;
|
|
40
|
+
/**
|
|
41
|
+
* Sets the color of the border around the pie chart.
|
|
42
|
+
* @param {string} borderColor The color of the border around the pie chart.
|
|
43
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
44
|
+
*
|
|
45
|
+
* @example
|
|
46
|
+
* ```ts
|
|
47
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
48
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
49
|
+
* if (!fWorksheet) return;
|
|
50
|
+
*
|
|
51
|
+
* // Create a pie chart with data source A1:D6.
|
|
52
|
+
* // The starting position is upper-left corner of cell B2.
|
|
53
|
+
* // The border color is set to red.
|
|
54
|
+
* const chartInfo = fWorksheet.newChart()
|
|
55
|
+
* .asPieChart()
|
|
56
|
+
* .addRange('A1:D6')
|
|
57
|
+
* .setPosition(1, 1, 0, 0)
|
|
58
|
+
* .setBorderColor('#ff0000')
|
|
59
|
+
* .build();
|
|
60
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
61
|
+
* ```
|
|
62
|
+
*/
|
|
63
|
+
setBorderColor(borderColor: string): this;
|
|
64
|
+
/**
|
|
65
|
+
* Sets whether the pie chart has a padding angle.
|
|
66
|
+
* @param {boolean} hasPaddingAngle True if the pie chart has a padding angle; false otherwise.
|
|
67
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
68
|
+
*
|
|
69
|
+
* @example
|
|
70
|
+
* ```ts
|
|
71
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
72
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
73
|
+
* if (!fWorksheet) return;
|
|
74
|
+
*
|
|
75
|
+
* // Create a pie chart with data source A1:D6.
|
|
76
|
+
* // The starting position is upper-left corner of cell B2.
|
|
77
|
+
* // The pie chart has a padding angle.
|
|
78
|
+
* const chartInfo = fWorksheet.newChart()
|
|
79
|
+
* .asPieChart()
|
|
80
|
+
* .addRange('A1:D6')
|
|
81
|
+
* .setPosition(1, 1, 0, 0)
|
|
82
|
+
* .setHasPaddingAngle(true)
|
|
83
|
+
* .build();
|
|
84
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
85
|
+
* ```
|
|
86
|
+
*/
|
|
87
|
+
setHasPaddingAngle(hasPaddingAngle: boolean): this;
|
|
88
|
+
/**
|
|
89
|
+
* Sets whether the pie chart is a half pie chart.
|
|
90
|
+
* @param {boolean} isHalfPie True if the pie chart is a half pie chart; false otherwise.
|
|
91
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
92
|
+
*
|
|
93
|
+
* @example
|
|
94
|
+
* ```ts
|
|
95
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
96
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
97
|
+
* if (!fWorksheet) return;
|
|
98
|
+
*
|
|
99
|
+
* // Create a pie chart with data source A1:D6.
|
|
100
|
+
* // The starting position is upper-left corner of cell B2.
|
|
101
|
+
* // The pie chart is a half pie chart.
|
|
102
|
+
* const chartInfo = fWorksheet.newChart()
|
|
103
|
+
* .asPieChart()
|
|
104
|
+
* .addRange('A1:D6')
|
|
105
|
+
* .setPosition(1, 1, 0, 0)
|
|
106
|
+
* .setIsHalfPie(true)
|
|
107
|
+
* .build();
|
|
108
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
109
|
+
* ```
|
|
110
|
+
*/
|
|
111
|
+
setIsHalfPie(isHalfPie: boolean): this;
|
|
112
|
+
/**
|
|
113
|
+
* Sets whether the pie chart is a rose pie chart.
|
|
114
|
+
* @param {boolean} rosePie True if the pie chart is a rose pie chart; false otherwise.
|
|
115
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
116
|
+
*
|
|
117
|
+
* @example
|
|
118
|
+
* ```ts
|
|
119
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
120
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
121
|
+
* if (!fWorksheet) return;
|
|
122
|
+
*
|
|
123
|
+
* // Create a pie chart with data source A1:D6.
|
|
124
|
+
* // The starting position is upper-left corner of cell B2.
|
|
125
|
+
* // The pie chart is a rose pie chart.
|
|
126
|
+
* const chartInfo = fWorksheet.newChart()
|
|
127
|
+
* .asPieChart()
|
|
128
|
+
* .addRange('A1:D6')
|
|
129
|
+
* .setPosition(1, 1, 0, 0)
|
|
130
|
+
* .setRosePie(true)
|
|
131
|
+
* .build();
|
|
132
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
135
|
+
setRosePie(rosePie: boolean): this;
|
|
136
|
+
/**
|
|
137
|
+
* Sets whether the pie chart shows label lines.
|
|
138
|
+
* @param {boolean} showLabelLine True if the pie chart shows label lines; false otherwise.
|
|
139
|
+
* @returns {PieChartBuilder} this builder, for chaining.
|
|
140
|
+
*
|
|
141
|
+
* @example
|
|
142
|
+
* ```ts
|
|
143
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
144
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
145
|
+
* if (!fWorksheet) return;
|
|
146
|
+
*
|
|
147
|
+
* // Create a pie chart with data source A1:D6.
|
|
148
|
+
* // The starting position is upper-left corner of cell B2.
|
|
149
|
+
* // The pie chart does not show label lines.
|
|
150
|
+
* const chartInfo = fWorksheet.newChart()
|
|
151
|
+
* .asPieChart()
|
|
152
|
+
* .addRange('A1:D6')
|
|
153
|
+
* .setPosition(1, 1, 0, 0)
|
|
154
|
+
* .setShowLabelLine(false)
|
|
155
|
+
* .build();
|
|
156
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
157
|
+
* ```
|
|
158
|
+
*/
|
|
159
|
+
setShowLabelLine(showLabelLine: boolean): this;
|
|
160
|
+
/**
|
|
161
|
+
* Builds the chart to reflect all changes made to it.
|
|
162
|
+
* @description This method does not automatically draw the chart on top of the spreadsheet. A new chart must be inserted via sheet.insertChart(chart), and an existing chart should be updated via sheet.updateChart(chart).
|
|
163
|
+
* @returns {IChartBuilderInfo} The chart builder info.
|
|
164
|
+
*
|
|
165
|
+
* @example
|
|
166
|
+
* ```ts
|
|
167
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
168
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
169
|
+
* if (!fWorksheet) return;
|
|
170
|
+
*
|
|
171
|
+
* // Create a pie chart with data source A1:D6.
|
|
172
|
+
* // The starting position is upper-left corner of cell B2.
|
|
173
|
+
* // The doughnut hole is set to 0.5.
|
|
174
|
+
* // The border color is set to red.
|
|
175
|
+
* // The pie chart has a padding angle.
|
|
176
|
+
* // The pie chart is a half pie chart.
|
|
177
|
+
* const chartInfo = fWorksheet.newChart()
|
|
178
|
+
* .asPieChart()
|
|
179
|
+
* .addRange('A1:D6')
|
|
180
|
+
* .setPosition(1, 1, 0, 0)
|
|
181
|
+
* .setDoughnutHole(0.5)
|
|
182
|
+
* .setBorderColor('#ff0000')
|
|
183
|
+
* .setHasPaddingAngle(true)
|
|
184
|
+
* .setIsHalfPie(true)
|
|
185
|
+
* .build();
|
|
186
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
187
|
+
* ```
|
|
188
|
+
*/
|
|
189
|
+
build(): IChartBuilderInfo;
|
|
190
|
+
}
|
|
191
|
+
/**
|
|
192
|
+
* @ignore
|
|
193
|
+
*/
|
|
194
|
+
export declare class PieChartBuilderMixin extends FChartBuilderBase {
|
|
195
|
+
asPieChart(): PieChartBuilder;
|
|
196
|
+
}
|
|
@@ -0,0 +1,100 @@
|
|
|
1
|
+
import type { RadarShape } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { Injector, Workbook } from '@univerjs/core';
|
|
3
|
+
import type { IChartBuilderInfo } from './chart-builder-base';
|
|
4
|
+
import { FChartBuilderBase } from './chart-builder-base';
|
|
5
|
+
/**
|
|
6
|
+
* The builder for creating a radar chart.
|
|
7
|
+
* @hideconstructor
|
|
8
|
+
*/
|
|
9
|
+
export declare class RadarChartBuilder extends FChartBuilderBase {
|
|
10
|
+
/**
|
|
11
|
+
* @property {RadarShape} shape The shape of the radar chart. The possible values are 'Polygon' and 'Circle'.
|
|
12
|
+
*/
|
|
13
|
+
shape: RadarShape;
|
|
14
|
+
/**
|
|
15
|
+
* @property {boolean} fill True if the radar chart is filled; false otherwise.
|
|
16
|
+
*/
|
|
17
|
+
fill: boolean;
|
|
18
|
+
constructor(unitId: string, subUnitId: string, workbook: Workbook, injector: Injector, chartId?: string);
|
|
19
|
+
/**
|
|
20
|
+
* Sets the shape of the radar chart.
|
|
21
|
+
* @param {RadarShape} shape The shape of the radar chart.
|
|
22
|
+
* @returns {RadarChartBuilder} this builder, for chaining.
|
|
23
|
+
*
|
|
24
|
+
* @example
|
|
25
|
+
* ```ts
|
|
26
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
27
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
28
|
+
* if (!fWorksheet) return;
|
|
29
|
+
*
|
|
30
|
+
* // Create a radar chart with data source A1:D6.
|
|
31
|
+
* // The starting position is upper-left corner of cell B2.
|
|
32
|
+
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
33
|
+
* const chartInfo = fWorksheet.newChart()
|
|
34
|
+
* .asRadarChart()
|
|
35
|
+
* .addRange('A1:D6')
|
|
36
|
+
* .setPosition(1, 1, 0, 0)
|
|
37
|
+
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
38
|
+
* .setFill(true)
|
|
39
|
+
* .build();
|
|
40
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
41
|
+
* ```
|
|
42
|
+
*/
|
|
43
|
+
setShape(shape: RadarShape): this;
|
|
44
|
+
/**
|
|
45
|
+
* Sets whether the radar chart is filled.
|
|
46
|
+
* @param {boolean} fill True if the radar chart is filled; false otherwise.
|
|
47
|
+
* @returns {RadarChartBuilder} this builder, for chaining.
|
|
48
|
+
*
|
|
49
|
+
* @example
|
|
50
|
+
* ```ts
|
|
51
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
52
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
53
|
+
* if (!fWorksheet) return;
|
|
54
|
+
*
|
|
55
|
+
* // Create a radar chart with data source A1:D6.
|
|
56
|
+
* // The starting position is upper-left corner of cell B2.
|
|
57
|
+
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
58
|
+
* const chartInfo = fWorksheet.newChart()
|
|
59
|
+
* .asRadarChart()
|
|
60
|
+
* .addRange('A1:D6')
|
|
61
|
+
* .setPosition(1, 1, 0, 0)
|
|
62
|
+
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
63
|
+
* .setFill(true)
|
|
64
|
+
* .build();
|
|
65
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
66
|
+
* ```
|
|
67
|
+
*/
|
|
68
|
+
setFill(fill: boolean): this;
|
|
69
|
+
/**
|
|
70
|
+
* Builds the chart to reflect all changes made to it.
|
|
71
|
+
* @description This method does not automatically draw the chart on top of the spreadsheet. A new chart must be inserted via sheet.insertChart(chart), and an existing chart should be updated via sheet.updateChart(chart).
|
|
72
|
+
* @returns {IChartBuilderInfo} The chart builder info.
|
|
73
|
+
*
|
|
74
|
+
* @example
|
|
75
|
+
* ```ts
|
|
76
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
77
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
78
|
+
* if (!fWorksheet) return;
|
|
79
|
+
*
|
|
80
|
+
* // Create a radar chart with data source A1:D6.
|
|
81
|
+
* // The starting position is upper-left corner of cell B2.
|
|
82
|
+
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
83
|
+
* const chartInfo = fWorksheet.newChart()
|
|
84
|
+
* .asRadarChart()
|
|
85
|
+
* .addRange('A1:D6')
|
|
86
|
+
* .setPosition(1, 1, 0, 0)
|
|
87
|
+
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
88
|
+
* .setFill(true)
|
|
89
|
+
* .build();
|
|
90
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
93
|
+
build(): IChartBuilderInfo;
|
|
94
|
+
}
|
|
95
|
+
/**
|
|
96
|
+
* @ignore
|
|
97
|
+
*/
|
|
98
|
+
export declare class RadarChartBuilderMixin extends FChartBuilderBase {
|
|
99
|
+
asRadarChart(): RadarChartBuilder;
|
|
100
|
+
}
|
|
@@ -0,0 +1,34 @@
|
|
|
1
|
+
import type { LineChartBuilder } from './line-chart-builder';
|
|
2
|
+
import type { PieChartBuilder } from './pie-chart-builder';
|
|
3
|
+
import type { RadarChartBuilder } from './radar-chart-builder';
|
|
4
|
+
/**
|
|
5
|
+
* @ignore
|
|
6
|
+
*/
|
|
7
|
+
export interface IPieChartBuilderMixin {
|
|
8
|
+
asPieChart(): PieChartBuilder;
|
|
9
|
+
}
|
|
10
|
+
/**
|
|
11
|
+
* @ignore
|
|
12
|
+
*/
|
|
13
|
+
export interface IRadarChartBuilderMixin {
|
|
14
|
+
asRadarChart(): RadarChartBuilder;
|
|
15
|
+
}
|
|
16
|
+
/**
|
|
17
|
+
* @ignore
|
|
18
|
+
*/
|
|
19
|
+
export interface ILineChartBuilderMixin {
|
|
20
|
+
asLineChart(): LineChartBuilder;
|
|
21
|
+
}
|
|
22
|
+
/**
|
|
23
|
+
* @ignore
|
|
24
|
+
*/
|
|
25
|
+
export interface IPieChartBuilderInfo {
|
|
26
|
+
pie?: {
|
|
27
|
+
doughnutHole: number;
|
|
28
|
+
borderColor: string;
|
|
29
|
+
hasPaddingAngle: boolean;
|
|
30
|
+
isHalfPie: boolean;
|
|
31
|
+
rosePie: boolean;
|
|
32
|
+
showLabelLine: boolean;
|
|
33
|
+
};
|
|
34
|
+
}
|
package/lib/types/index.d.ts
CHANGED
|
@@ -1,7 +1,7 @@
|
|
|
1
1
|
export { SheetChartConfigAdapter } from './chart-builder/sheet-chart-config-adapter';
|
|
2
2
|
export type { ISheetChartConfigAdapter, ISheetChartHostPatch, } from './chart-builder/sheet-chart-config-adapter';
|
|
3
3
|
export type { ISheetChartDescriptionExtension } from './chart-builder/sheet-chart-description';
|
|
4
|
-
export { resolveInitialChartPosition } from './chart-builder/sheet-chart-layout';
|
|
4
|
+
export { buildLayoutDrawingPatch, resolveInitialChartPosition } from './chart-builder/sheet-chart-layout';
|
|
5
5
|
export { resolveSourceSeries, resolveSourceSpec } from './chart-builder/sheet-chart-source';
|
|
6
6
|
export type { ISheetChartSourceContext, } from './chart-builder/sheet-chart-source';
|
|
7
7
|
export { ChartDiagnosticSeverity, ChartSourceKind, ChartSourceOrientation, } from './chart-builder/types';
|
|
@@ -10,7 +10,7 @@ export { ChartUpdateConfigCommand, ReplaceSheetChartConfig } from './commands/co
|
|
|
10
10
|
export type { IChartUpdateConfigCommandParams } from './commands/commands/sheets-chart-update-config.command';
|
|
11
11
|
export { ChartUpdateSourceCommand } from './commands/commands/sheets-chart-update-source.command';
|
|
12
12
|
export type { IChartUpdateSourceCommandParams } from './commands/commands/sheets-chart-update-source.command';
|
|
13
|
-
export { InsertChartCommand } from './commands/commands/sheets-chart.command';
|
|
13
|
+
export { InsertChartCommand, resolveDefaultChartPosition } from './commands/commands/sheets-chart.command';
|
|
14
14
|
export type { IInsertChartCommandParams } from './commands/commands/sheets-chart.command';
|
|
15
15
|
export { ChartUpdateSourceConfigMutation } from './commands/mutations/sheet-chart-update-source.mutation';
|
|
16
16
|
export type { IChartUpdateSourceConfigMutationParams } from './commands/mutations/sheet-chart-update-source.mutation';
|
|
@@ -0,0 +1,22 @@
|
|
|
1
|
+
import type { ChartStyle, ChartTypeBits, IChartContext, IChartDataAggregation, IChartLocaleTexts } from '@univerjs-pro/engine-chart';
|
|
2
|
+
import type { Injector } from '@univerjs/core';
|
|
3
|
+
import type { ChartDataSourceSingle } from '../chart-source/chart-source';
|
|
4
|
+
import type { ISheetChartDataSource } from './types';
|
|
5
|
+
import { ChartModel } from '@univerjs-pro/engine-chart';
|
|
6
|
+
import { LocaleService } from '@univerjs/core';
|
|
7
|
+
export interface IChartModelInit {
|
|
8
|
+
chartType?: ChartTypeBits;
|
|
9
|
+
dataSource: ISheetChartDataSource;
|
|
10
|
+
dataAggregation?: IChartDataAggregation;
|
|
11
|
+
context?: Pick<IChartContext, 'categoryIndex' | 'seriesIndexes' | 'transform'>;
|
|
12
|
+
style?: ChartStyle;
|
|
13
|
+
localeTexts?: IChartLocaleTexts;
|
|
14
|
+
}
|
|
15
|
+
export declare function buildLocaleTexts(localeService: LocaleService): IChartLocaleTexts;
|
|
16
|
+
export declare class SheetChartModel extends ChartModel {
|
|
17
|
+
_dataSource: ChartDataSourceSingle;
|
|
18
|
+
get dataSource(): ChartDataSourceSingle;
|
|
19
|
+
constructor(id: string, options: IChartModelInit, _injector: Injector);
|
|
20
|
+
_init(): void;
|
|
21
|
+
dispose(): void;
|
|
22
|
+
}
|
|
@@ -15,7 +15,7 @@ export declare class SheetChartDataSourceManager extends Disposable {
|
|
|
15
15
|
private readonly _handles;
|
|
16
16
|
private _isDisposed;
|
|
17
17
|
constructor(_univerInstanceService: IUniverInstanceService, _rangeWatcherManager: SheetChartRangeWatcherManager);
|
|
18
|
-
acquire(rangeInfo: ISheetChartSourceRanges): ISheetChartDataSourceHandle;
|
|
18
|
+
acquire(rangeInfo: ISheetChartSourceRanges, plotVisibleOnly?: boolean): ISheetChartDataSourceHandle;
|
|
19
19
|
refreshAll(): void;
|
|
20
20
|
private _getOrCreateEntry;
|
|
21
21
|
private _refreshEntry;
|
|
@@ -1,7 +1,8 @@
|
|
|
1
|
-
import type {
|
|
1
|
+
import type { ChartTypeBits, IChartSnapshot } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import type { Nullable } from '@univerjs/core';
|
|
3
3
|
import type { IInitialSheetChartMapping, IInitialSheetChartSourceResult } from '../chart-source/initial-sheet-chart-source-inference';
|
|
4
4
|
import type { ISheetChartDataSource, ISheetChartSourceRanges } from '../models/types';
|
|
5
|
+
import { ChartModel } from '@univerjs-pro/engine-chart';
|
|
5
6
|
import { Disposable, ILogService, IResourceManagerService, IUniverInstanceService, LocaleService } from '@univerjs/core';
|
|
6
7
|
import { ChartModelService } from './chart-model.service';
|
|
7
8
|
import { SheetChartDataSourceManager } from './sheet-chart-data-source-manager';
|
package/lib/umd/facade.js
CHANGED
|
@@ -1 +1 @@
|
|
|
1
|
-
function
|
|
1
|
+
function _0x5154(){const _0x4a3cf5=['categoryIndex','@univerjs-pro/engine-chart/facade','getRange','FWorksheet','size','resolveSourceSpec','getUnitId','createInstance','ChartSourceKind','_injector','width','setHeader','9237FbEPxA','kind','FEnum','function','isArray','ICommandService','ChartDiagnosticSeverity','severity','@univerjs/core','dataAggregation','FSheetChart','3165170NpLroR','commitHost','UniverCore','1350RdLIcO','toStringTag','@univerjs-pro/engine-chart','ranges','@univerjs-pro/sheets-chart','get','getWorkbook','UniverProSheetsChart','952063kVcsfL','unitId','getUnitChartModels','getChartSourceSpec','insertChart','875794kYLBiJ','@univerjs/core/facade','SheetsChartService','FChart','396964YGfihS','getSheetId','Failed\x20to\x20create\x20Sheet\x20chart.','createChartBuilder','UniverSheetsFacade','UniverCoreFacade','exports','executeCommand','19384XJcUZG','getInject','filter','setPlotVisibleOnly','mapping','some','defineProperty','60EjNzay','style','getCharts','109806SlbIvO','_chartSourceContext','theme','_createSheetAdapter','getPlotVisibleOnly','Range','chartId','newChart','@univerjs/sheets/facade','Module','generateRandomId','subUnitId','getChart','extend','SheetChartConfigAdapter','InsertChartCommand','chartTypeToBits','UniverProEngineChartFacade','map','rangeInfo','LocaleService','anchor','join','195oxgXQi','ChartSourceOrientation'];_0x5154=function(){return _0x4a3cf5;};return _0x5154();}function _0x2fce(_0x13948a,_0x1e6fd2){_0x13948a=_0x13948a-0x9d;const _0x5154e1=_0x5154();let _0x2fcefd=_0x5154e1[_0x13948a];return _0x2fcefd;}(function(_0x45f4ac,_0x2158a0){const _0x5d9ac5=_0x2fce,_0x1a7a96=_0x45f4ac();while(!![]){try{const _0x485bd3=parseInt(_0x5d9ac5(0xd1))/0x1+parseInt(_0x5d9ac5(0xcd))/0x2+-parseInt(_0x5d9ac5(0xb2))/0x3*(parseInt(_0x5d9ac5(0xe0))/0x4)+parseInt(_0x5d9ac5(0xa4))/0x5*(-parseInt(_0x5d9ac5(0xe3))/0x6)+-parseInt(_0x5d9ac5(0xc8))/0x7+parseInt(_0x5d9ac5(0xd9))/0x8*(parseInt(_0x5d9ac5(0xc0))/0x9)+parseInt(_0x5d9ac5(0xbd))/0xa;if(_0x485bd3===_0x2158a0)break;else _0x1a7a96['push'](_0x1a7a96['shift']());}catch(_0x1e6e07){_0x1a7a96['push'](_0x1a7a96['shift']());}}}(_0x5154,0x9718f),function(_0x103a49,_0x3a4763){const _0x11d7a8=_0x2fce;typeof exports=='object'&&typeof module<'u'?_0x3a4763(exports,require('@univerjs-pro/engine-chart'),require('@univerjs-pro/engine-chart/facade'),require('@univerjs-pro/sheets-chart'),require('@univerjs/core'),require('@univerjs/sheets/facade'),require('@univerjs/core/facade')):typeof define==_0x11d7a8(0xb5)&&define['amd']?define([_0x11d7a8(0xd7),_0x11d7a8(0xc2),_0x11d7a8(0xa7),_0x11d7a8(0xc4),_0x11d7a8(0xba),_0x11d7a8(0xeb),_0x11d7a8(0xce)],_0x3a4763):(_0x103a49=typeof globalThis<'u'?globalThis:_0x103a49||self,_0x3a4763(_0x103a49['UniverProSheetsChartFacade']={},_0x103a49['UniverProEngineChart'],_0x103a49[_0x11d7a8(0x9e)],_0x103a49[_0x11d7a8(0xc7)],_0x103a49[_0x11d7a8(0xbf)],_0x103a49[_0x11d7a8(0xd5)],_0x103a49[_0x11d7a8(0xd6)]));}(this,function(_0x565e9f,_0x5e5d01,_0x41ca06,_0x4f7ce0,_0x37a8e4,_0x3e2da1,_0x54d867){const _0x4f48d5=_0x2fce;Object[_0x4f48d5(0xdf)](_0x565e9f,Symbol[_0x4f48d5(0xc1)],{'value':_0x4f48d5(0xec)});var _0x46e3a1=class extends _0x41ca06[_0x4f48d5(0xd0)]{constructor(_0x598adb,_0x1b3ef5,_0x2b2939,_0xde778c){const _0x26829b=_0x4f48d5;super(_0x2b2939,()=>new _0x4f7ce0[(_0x26829b(0xf1))]({'unitId':_0x598adb,'subUnitId':_0x1b3ef5,'chartId':_0x2b2939,'injector':_0xde778c}),(_0x5d5119,_0x45cb50,_0x44b94c)=>(0x0,_0x41ca06[_0x26829b(0xd4)])({'info':_0x5d5119,'description':_0x45cb50,'type':_0x44b94c,'normalizeSource':_0x255c64=>_0x255c64,'extension':({setInfo:_0x122c64})=>({'setPosition'(_0x341f4f){const _0x23ab8d=_0x26829b;return _0x122c64(_0x23ab8d(0xa2),_0x341f4f),this;}})}),_0xde778c),this['unitId']=_0x598adb,this[_0x26829b(0xee)]=_0x1b3ef5,this[_0x26829b(0xe9)]=_0x2b2939;}[_0x4f48d5(0xa8)](){const _0x102de3=_0x4f48d5;let _0x144b4d=this['_injector'][_0x102de3(0xc5)](_0x4f7ce0[_0x102de3(0xcf)])[_0x102de3(0xcb)](this[_0x102de3(0xe9)]);return _0x144b4d&&!Array[_0x102de3(0xb6)](_0x144b4d)?_0x144b4d:void 0x0;}['setPosition'](_0x1bc23b){const _0x2aa5c3=_0x4f48d5;return this[_0x2aa5c3(0xe6)]()[_0x2aa5c3(0xbe)]({'layout':{'anchor':_0x1bc23b}}),this;}async[_0x4f48d5(0xb1)](_0x4cef54){const _0x28f261=_0x4f48d5;this[_0x28f261(0xe6)]()[_0x28f261(0xb1)](_0x4cef54);}[_0x4f48d5(0xdc)](_0x19f793){return this['_createSheetAdapter']()['commit']({'plotVisibleOnly':_0x19f793}),this;}[_0x4f48d5(0xe7)](){const _0x4e4c35=_0x4f48d5;return this[_0x4e4c35(0xe6)]()[_0x4e4c35(0xe7)]();}[_0x4f48d5(0xe6)](){const _0x50a7ed=_0x4f48d5;return new _0x4f7ce0[(_0x50a7ed(0xf1))]({'unitId':this[_0x50a7ed(0xc9)],'subUnitId':this[_0x50a7ed(0xee)],'chartId':this[_0x50a7ed(0xe9)],'injector':this['_injector']});}},_0x7661a3=class extends _0x3e2da1[_0x4f48d5(0xa9)]{[_0x4f48d5(0xea)](_0x2841b3){const _0x1077ce=_0x4f48d5;return(0x0,_0x41ca06['createChartBuilder'])({'type':_0x2841b3,'injector':this[_0x1077ce(0xaf)],'commitError':'Insert\x20the\x20Sheet\x20chart\x20before\x20updating\x20it.','normalizeSource':_0x514caa=>_0x514caa,'createInfo':()=>({'anchor':void 0x0}),'extension':({setInfo:_0x3d8172})=>({'setPosition'(_0xfb44d2){const _0x571282=_0x1077ce;return _0x3d8172(_0x571282(0xa2),_0xfb44d2),this;}})});}async[_0x4f48d5(0xcc)](_0x4e7119){const _0x528337=_0x4f48d5;var _0x57e83a,_0xd2a55e,_0x4f0a70;let {config:_0x83458d,dataSource:_0x1541f3,anchor:_0x52846a,position:_0x153718,size:_0x1c2838}=_0x4e7119,_0x17f4bd={..._0x83458d,'source':_0x1541f3,'anchor':_0x52846a,'position':_0x153718,'size':_0x1c2838},_0x2a6dab=(0x0,_0x5e5d01[_0x528337(0x9d)])(_0x17f4bd['type']),_0x45967d=this['_chartSourceContext'](_0x2a6dab),_0x451306=[],_0x58e49a=(0x0,_0x4f7ce0[_0x528337(0xab)])(_0x17f4bd['source'],_0x45967d,_0x451306);if(!_0x58e49a||_0x451306[_0x528337(0xde)](_0x191ccc=>_0x191ccc[_0x528337(0xb9)]===_0x4f7ce0[_0x528337(0xb8)]['Error']))throw Error(_0x451306[_0x528337(0x9f)](_0x533467=>_0x533467['message'])[_0x528337(0xa3)](';\x20')||'Invalid\x20Sheet\x20chart\x20source.');let _0x1b9b7c=(0x0,_0x37a8e4[_0x528337(0xed)])(),_0x59b1d8=(0x0,_0x5e5d01['toChartModelConfig'])(_0x17f4bd,{'series':(0x0,_0x4f7ce0['resolveSourceSeries'])(_0x58e49a,_0x45967d,((_0x57e83a=_0x17f4bd[_0x528337(0xdd)])==null?void 0x0:_0x57e83a[_0x528337(0xa6)])??0x0)}),_0xb06cc7=(0x0,_0x4f7ce0['resolveInitialChartPosition'])({'unitId':_0x45967d[_0x528337(0xc9)],'subUnitId':_0x45967d['subUnitId'],'injector':this[_0x528337(0xda)]()},_0x17f4bd,_0x451306),_0x338a17={'unitId':_0x45967d['unitId'],'subUnitId':_0x45967d['subUnitId'],'chartId':_0x1b9b7c,'chartType':_0x2a6dab,'source':_0x58e49a[_0x528337(0xb3)]===_0x4f7ce0[_0x528337(0xae)][_0x528337(0xe8)]?_0x58e49a[_0x528337(0xa0)]:_0x58e49a[_0x528337(0xc3)],'position':_0xb06cc7,'width':(_0xd2a55e=_0x17f4bd['size'])==null?void 0x0:_0xd2a55e[_0x528337(0xb0)],'height':(_0x4f0a70=_0x17f4bd[_0x528337(0xaa)])==null?void 0x0:_0x4f0a70['height'],'theme':_0x17f4bd[_0x528337(0xe5)]??void 0x0,'config':{'unitId':_0x45967d['unitId'],'chartModelId':_0x1b9b7c,'style':_0x59b1d8[_0x528337(0xe1)],'context':_0x59b1d8['context'],'dataAggregation':_0x59b1d8[_0x528337(0xbb)]}};if(!await this[_0x528337(0xda)]()['get'](_0x37a8e4[_0x528337(0xb7)])[_0x528337(0xd8)](_0x4f7ce0[_0x528337(0xf2)]['id'],_0x338a17))throw Error(_0x528337(0xd3));return this[_0x528337(0xaf)][_0x528337(0xad)](_0x46e3a1,_0x45967d[_0x528337(0xc9)],_0x45967d['subUnitId'],_0x1b9b7c,this[_0x528337(0xaf)]);}[_0x4f48d5(0xef)](_0x22e65e){const _0xddeb08=_0x4f48d5;let {unitId:_0x5aaf50,subUnitId:_0x1b768e}=this[_0xddeb08(0xe4)](),_0x17f9cd=this['getInject']()[_0xddeb08(0xc5)](_0x4f7ce0[_0xddeb08(0xcf)]);return _0x17f9cd['getChartModel'](_0x22e65e)&&_0x17f9cd['getSubUnitId'](_0x5aaf50,_0x22e65e)===_0x1b768e?this[_0xddeb08(0xaf)][_0xddeb08(0xad)](_0x46e3a1,_0x5aaf50,_0x1b768e,_0x22e65e,this[_0xddeb08(0xaf)]):null;}[_0x4f48d5(0xe2)](){const _0x4b32fb=_0x4f48d5;let {unitId:_0x33c474,subUnitId:_0x3178ad}=this['_chartSourceContext']();return this['getInject']()[_0x4b32fb(0xc5)](_0x4f7ce0['SheetsChartService'])[_0x4b32fb(0xca)](_0x33c474,_0x3178ad)[_0x4b32fb(0xdb)](Boolean)['map'](_0xe06214=>this[_0x4b32fb(0xaf)][_0x4b32fb(0xad)](_0x46e3a1,_0x33c474,_0x3178ad,_0xe06214['id'],this[_0x4b32fb(0xaf)]));}[_0x4f48d5(0xe4)](_0x4c00e8){const _0x596ee5=_0x4f48d5;let _0x817f39=this[_0x596ee5(0xc6)](),_0x42f264=this[_0x596ee5(0xda)]()['get'](_0x4f7ce0[_0x596ee5(0xcf)]);return{'unitId':_0x817f39[_0x596ee5(0xac)](),'subUnitId':this[_0x596ee5(0xd2)](),'workbook':_0x817f39,'localeService':this[_0x596ee5(0xaf)]['get'](_0x37a8e4[_0x596ee5(0xa1)]),..._0x4c00e8===void 0x0?{}:{'inferInitialChartSource':_0x457dc1=>_0x42f264['inferInitialChartSource'](_0x457dc1,_0x4c00e8)}};}};_0x3e2da1[_0x4f48d5(0xa9)]['extend'](_0x7661a3);var _0x11fabf=class extends _0x54d867['FEnum']{get[_0x4f48d5(0xa5)](){const _0x5a9816=_0x4f48d5;return _0x4f7ce0[_0x5a9816(0xa5)];}};_0x54d867[_0x4f48d5(0xb4)][_0x4f48d5(0xf0)](_0x11fabf),_0x565e9f[_0x4f48d5(0xbc)]=_0x46e3a1;}));
|