@univerjs-pro/sheets-chart 1.0.0-alpha.2 → 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/README.md +8 -2
- 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/index.d.ts +10 -0
- package/lib/types/chart-builder/sheet-chart-builder-adapter.d.ts +41 -0
- package/lib/types/chart-builder/sheet-chart-builder.d.ts +17 -0
- package/lib/types/chart-builder/sheet-chart-create-spec.d.ts +6 -0
- package/lib/types/chart-builder/sheet-chart-description.d.ts +5 -0
- package/lib/types/chart-builder/sheet-chart-layout.d.ts +21 -0
- package/lib/types/chart-builder/sheet-chart-source.d.ts +32 -0
- package/lib/types/chart-builder/types.d.ts +159 -0
- package/lib/types/chart-source/chart-source.d.ts +14 -7
- package/lib/types/commands/commands/sheets-chart-update-config.command.d.ts +2 -0
- package/lib/types/commands/commands/sheets-chart.command.d.ts +3 -4
- package/lib/types/commands/mutations/sheets-chart-update-config.mutation.d.ts +1 -0
- package/lib/types/commands/mutations/sheets-chart.mutation.d.ts +15 -5
- package/lib/types/common/util.d.ts +1 -1
- package/lib/types/facade/chart/f-sheet-chart-builder.d.ts +83 -0
- package/lib/types/facade/chart/f-sheet-charts.d.ts +100 -0
- package/lib/types/facade/chart/index.d.ts +2 -0
- package/lib/types/facade/chart/sheet-chart-command-adapter.d.ts +13 -0
- package/lib/types/facade/f-chart.d.ts +1 -143
- package/lib/types/facade/f-enum.d.ts +7 -205
- package/lib/types/facade/f-worksheet-charts.d.ts +3 -19
- package/lib/types/facade/index.d.ts +3 -23
- package/lib/types/index.d.ts +7 -6
- package/lib/types/models/chart-model.d.ts +3 -3
- package/lib/types/models/types.d.ts +14 -1
- package/lib/types/plugin.d.ts +1 -0
- package/lib/types/services/chart-model.service.d.ts +2 -0
- package/lib/types/services/sheet-chart-range-watcher.d.ts +22 -0
- package/lib/types/services/sheets-chart.service.d.ts +8 -8
- 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 +10 -10
- package/lib/types/facade/chart-builder/builder-util.d.ts +0 -5
- package/lib/types/facade/chart-builder/chart-builder-base.d.ts +0 -919
- package/lib/types/facade/chart-builder/line-chart-builder.d.ts +0 -165
- package/lib/types/facade/chart-builder/pie-chart-builder.d.ts +0 -196
- package/lib/types/facade/chart-builder/radar-chart-builder.d.ts +0 -100
- package/lib/types/facade/chart-builder/types.d.ts +0 -34
- package/lib/types/facade/chart-facade-adapter.d.ts +0 -58
- package/lib/types/facade/chart-facade-builders.d.ts +0 -62
- package/lib/types/facade/chart-facade-types.d.ts +0 -393
- package/lib/types/facade/f-worksheet.d.ts +0 -205
|
@@ -1,165 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,196 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,100 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,34 +0,0 @@
|
|
|
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
|
-
}
|
|
@@ -1,58 +0,0 @@
|
|
|
1
|
-
import type { ChartStyle, ChartTypeBits as ChartTypeBitsType, IChartContext, IChartDataAggregation, IChartDataSeries } from '@univerjs-pro/engine-chart';
|
|
2
|
-
import type { ISheetChartSourceSingleRange } from '@univerjs-pro/sheets-chart';
|
|
3
|
-
import type { Injector, IRange, Workbook } from '@univerjs/core';
|
|
4
|
-
import type { ChartCapabilities, ChartCreateSpec, ChartDescription, ChartDiagnostic, ChartDiagnosticCode, ChartInstanceCapabilities, ChartKnownTypeName, ChartLayoutPatch, ChartSourceDescription, ChartSourceSpec, ChartSuggestion, ChartTypeName, ChartUpdatePatch, ChartValidationResult } from './chart-facade-types';
|
|
5
|
-
import { SheetsChartService } from '@univerjs-pro/sheets-chart';
|
|
6
|
-
import { ISheetDrawingService } from '@univerjs/sheets-drawing';
|
|
7
|
-
export declare class ChartFacadeError extends Error {
|
|
8
|
-
readonly diagnostics: ChartDiagnostic[];
|
|
9
|
-
constructor(message: string, diagnostics: ChartDiagnostic[]);
|
|
10
|
-
}
|
|
11
|
-
export declare function diagnostic(code: ChartDiagnosticCode, message: string, path?: string, severity?: ChartDiagnostic['severity'], details?: unknown, metadata?: Pick<ChartDiagnostic, 'allowedValues' | 'suggestion'>): ChartDiagnostic;
|
|
12
|
-
export declare function hasError(diagnostics: ChartDiagnostic[]): boolean;
|
|
13
|
-
export declare function throwIfInvalid(result: ChartValidationResult): void;
|
|
14
|
-
export declare function chartTypeNameToBits(type: unknown, diagnostics: ChartDiagnostic[], path?: string): ChartTypeBitsType | null;
|
|
15
|
-
export declare function chartTypeBitsToName(type: ChartTypeBitsType, style?: ChartStyle): ChartTypeName;
|
|
16
|
-
export declare function buildDonutStyle(type: ChartKnownTypeName | undefined): ChartStyle | undefined;
|
|
17
|
-
export interface IChartFacadeSourceContext {
|
|
18
|
-
unitId: string;
|
|
19
|
-
subUnitId: string;
|
|
20
|
-
workbook: Workbook;
|
|
21
|
-
}
|
|
22
|
-
export type ChartFacadeSourceContext = IChartFacadeSourceContext;
|
|
23
|
-
export interface IResolvedChartSource {
|
|
24
|
-
range: IRange;
|
|
25
|
-
sourceSheetName?: string;
|
|
26
|
-
rangeInfo: ISheetChartSourceSingleRange;
|
|
27
|
-
isRowDirection?: boolean;
|
|
28
|
-
}
|
|
29
|
-
export type ResolvedChartSource = IResolvedChartSource;
|
|
30
|
-
export declare function resolveSourceSpec(source: ChartSourceSpec | undefined, context: ChartFacadeSourceContext, diagnostics: ChartDiagnostic[], path?: string): ResolvedChartSource | null;
|
|
31
|
-
export declare function validateCreateSpec(spec: ChartCreateSpec, context: ChartFacadeSourceContext): ChartValidationResult<ChartCreateSpec>;
|
|
32
|
-
export declare function validateUpdatePatch(patch: ChartUpdatePatch, context: ChartFacadeSourceContext): ChartValidationResult<ChartUpdatePatch>;
|
|
33
|
-
export interface IChartConfigPatch {
|
|
34
|
-
chartType?: ChartTypeBitsType;
|
|
35
|
-
style?: ChartStyle;
|
|
36
|
-
context?: IChartContext;
|
|
37
|
-
dataAggregation?: Partial<IChartDataAggregation>;
|
|
38
|
-
}
|
|
39
|
-
export type ChartConfigPatch = IChartConfigPatch;
|
|
40
|
-
export declare function buildChartConfigPatch(patch: ChartCreateSpec | ChartUpdatePatch, diagnostics: ChartDiagnostic[], series?: IChartDataSeries[], currentContext?: IChartContext): ChartConfigPatch;
|
|
41
|
-
export declare function buildSourceDescription(source: ISheetChartSourceSingleRange, workbook?: Workbook): ChartSourceDescription;
|
|
42
|
-
export declare function buildSuggestions(source: ChartSourceSpec, context: ChartFacadeSourceContext, sheetsChartService: SheetsChartService): ChartSuggestion[];
|
|
43
|
-
export declare function getWorksheetChartCapabilities(): ChartCapabilities;
|
|
44
|
-
export declare function getChartInstanceCapabilities(chartId: string, type: ChartTypeName, rawType?: number): ChartInstanceCapabilities;
|
|
45
|
-
export interface IChartRuntimeContext {
|
|
46
|
-
unitId: string;
|
|
47
|
-
subUnitId: string;
|
|
48
|
-
chartId: string;
|
|
49
|
-
injector: Injector;
|
|
50
|
-
}
|
|
51
|
-
export type ChartRuntimeContext = IChartRuntimeContext;
|
|
52
|
-
export declare function describeChart(context: ChartRuntimeContext): ChartDescription | null;
|
|
53
|
-
export declare function getWorkbook(injector: Injector, unitId: string): Workbook | null;
|
|
54
|
-
export declare function buildLayoutDrawingPatch(context: ChartRuntimeContext, layout: ChartLayoutPatch, diagnostics: ChartDiagnostic[]): NonNullable<ReturnType<ISheetDrawingService['getDrawingByParam']>> | null;
|
|
55
|
-
export declare function resolveInitialChartPosition(context: Pick<ChartRuntimeContext, 'unitId' | 'subUnitId' | 'injector'>, layout: Pick<ChartCreateSpec, 'anchor' | 'position'>, diagnostics: ChartDiagnostic[]): {
|
|
56
|
-
x: number;
|
|
57
|
-
y: number;
|
|
58
|
-
} | undefined;
|
|
@@ -1,62 +0,0 @@
|
|
|
1
|
-
import type { ChartAdvancedStylePatch, ChartAggregationSpec, ChartAnchorSpec, ChartAppearanceSpec, ChartAxesSpec, ChartCreateSpec, ChartKnownTypeName, ChartLayoutPatch, ChartLegendSpec, ChartMappingSpec, ChartPieSpec, ChartRadarSpec, ChartSeriesPatch, ChartSourceSpec, ChartTitleSpec, ChartUpdatePatch, ChartUpdateResult, ChartValidationResult, ChartWordCloudSpec } from './chart-facade-types';
|
|
2
|
-
import type { FChart } from './f-chart';
|
|
3
|
-
export declare class ChartCreateBuilder {
|
|
4
|
-
private readonly _create;
|
|
5
|
-
private readonly _validate;
|
|
6
|
-
private readonly _spec;
|
|
7
|
-
constructor(_create: (spec: ChartCreateSpec) => Promise<FChart>, _validate: (spec: ChartCreateSpec) => ChartValidationResult<ChartCreateSpec>);
|
|
8
|
-
type(type: ChartKnownTypeName): this;
|
|
9
|
-
source(source: ChartSourceSpec): this;
|
|
10
|
-
column(source: ChartSourceSpec): this;
|
|
11
|
-
line(source: ChartSourceSpec): this;
|
|
12
|
-
bar(source: ChartSourceSpec): this;
|
|
13
|
-
pie(source: ChartSourceSpec): this;
|
|
14
|
-
radar(source: ChartSourceSpec): this;
|
|
15
|
-
wordCloud(source: ChartSourceSpec): this;
|
|
16
|
-
at(anchor: ChartAnchorSpec): this;
|
|
17
|
-
position(x: number, y: number): this;
|
|
18
|
-
size(width: number, height: number): this;
|
|
19
|
-
title(title: ChartTitleSpec): this;
|
|
20
|
-
legend(legend: ChartLegendSpec): this;
|
|
21
|
-
axes(axes: ChartAxesSpec): this;
|
|
22
|
-
series(series: ChartSeriesPatch[]): this;
|
|
23
|
-
wordCloudOptions(wordCloud: ChartWordCloudSpec): this;
|
|
24
|
-
appearance(appearance: ChartAppearanceSpec): this;
|
|
25
|
-
mapping(mapping: ChartMappingSpec): this;
|
|
26
|
-
aggregation(aggregation: ChartAggregationSpec): this;
|
|
27
|
-
pieOptions(pie: ChartPieSpec): this;
|
|
28
|
-
radarOptions(radar: ChartRadarSpec): this;
|
|
29
|
-
advancedStyle(advancedStyle: ChartAdvancedStylePatch): this;
|
|
30
|
-
theme(theme: string): this;
|
|
31
|
-
toSpec(): ChartCreateSpec;
|
|
32
|
-
validate(): ChartValidationResult<ChartCreateSpec>;
|
|
33
|
-
commit(): Promise<FChart>;
|
|
34
|
-
}
|
|
35
|
-
export declare class ChartUpdateBuilder {
|
|
36
|
-
private readonly _update;
|
|
37
|
-
private readonly _validate;
|
|
38
|
-
private readonly _patch;
|
|
39
|
-
constructor(_update: (patch: ChartUpdatePatch) => Promise<ChartUpdateResult>, _validate: (patch: ChartUpdatePatch) => ChartValidationResult<ChartUpdatePatch>);
|
|
40
|
-
type(type: ChartKnownTypeName): this;
|
|
41
|
-
source(source: ChartSourceSpec): this;
|
|
42
|
-
layout(layout: ChartLayoutPatch): this;
|
|
43
|
-
at(anchor: ChartAnchorSpec): this;
|
|
44
|
-
position(x: number, y: number): this;
|
|
45
|
-
size(width: number, height: number): this;
|
|
46
|
-
title(title: ChartTitleSpec): this;
|
|
47
|
-
legend(legend: ChartLegendSpec): this;
|
|
48
|
-
axes(axes: ChartAxesSpec): this;
|
|
49
|
-
series(series: ChartSeriesPatch[]): this;
|
|
50
|
-
setSeries(series: ChartSeriesPatch): this;
|
|
51
|
-
wordCloud(wordCloud: ChartWordCloudSpec): this;
|
|
52
|
-
appearance(appearance: ChartAppearanceSpec): this;
|
|
53
|
-
mapping(mapping: ChartMappingSpec): this;
|
|
54
|
-
aggregation(aggregation: ChartAggregationSpec): this;
|
|
55
|
-
pieOptions(pie: ChartPieSpec): this;
|
|
56
|
-
radarOptions(radar: ChartRadarSpec): this;
|
|
57
|
-
advancedStyle(advancedStyle: ChartAdvancedStylePatch): this;
|
|
58
|
-
theme(theme: string): this;
|
|
59
|
-
toSpec(): ChartUpdatePatch;
|
|
60
|
-
validate(): ChartValidationResult<ChartUpdatePatch>;
|
|
61
|
-
commit(): Promise<ChartUpdateResult>;
|
|
62
|
-
}
|