@univerjs-pro/sheets-chart-ui 0.19.0 → 0.20.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/index.js +1 -1
- package/lib/cjs/locale/ca-ES.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/ja-JP.js +1 -1
- package/lib/cjs/locale/ko-KR.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-TW.js +1 -1
- package/lib/es/index.js +1 -1
- package/lib/es/locale/ca-ES.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/ja-JP.js +1 -1
- package/lib/es/locale/ko-KR.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-TW.js +1 -1
- package/lib/index.js +1 -1
- package/lib/locale/ca-ES.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/ja-JP.js +1 -1
- package/lib/locale/ko-KR.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-TW.js +1 -1
- package/lib/types/commands/commands/sheet-chart-menu.command.d.ts +1 -4
- package/lib/types/controllers/sheets-chart-clipboard.controller.d.ts +3 -3
- package/lib/types/controllers/sheets-chart-ui.controller.d.ts +2 -6
- package/lib/types/index.d.ts +0 -2
- package/lib/umd/index.js +1 -1
- package/lib/umd/locale/ca-ES.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/ja-JP.js +1 -1
- package/lib/umd/locale/ko-KR.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-TW.js +1 -1
- package/package.json +15 -25
- package/lib/cjs/facade.js +0 -1
- package/lib/es/facade.js +0 -1
- package/lib/facade.js +0 -1
- package/lib/types/commands/commands/sheets-chart.command.d.ts +0 -24
- package/lib/types/const.d.ts +0 -9
- package/lib/types/facade/chart-builder/builder-util.d.ts +0 -5
- package/lib/types/facade/chart-builder/chart-builder-base.d.ts +0 -899
- package/lib/types/facade/chart-builder/line-chart-builder.d.ts +0 -160
- package/lib/types/facade/chart-builder/pie-chart-builder.d.ts +0 -189
- package/lib/types/facade/chart-builder/radar-chart-builder.d.ts +0 -97
- package/lib/types/facade/chart-builder/types.d.ts +0 -34
- package/lib/types/facade/f-chart.d.ts +0 -127
- package/lib/types/facade/f-enum.d.ts +0 -203
- package/lib/types/facade/f-worksheet.d.ts +0 -199
- package/lib/types/facade/index.d.ts +0 -20
- package/lib/umd/facade.js +0 -1
|
@@ -1,160 +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.getActiveSheet();
|
|
36
|
-
*
|
|
37
|
-
* // Create a line chart builder with data source A1:D6.
|
|
38
|
-
* // The starting position is upper-left corner of cell B2.
|
|
39
|
-
* // The line style is set to the step type.
|
|
40
|
-
* const chartInfo = fWorksheet.newChart()
|
|
41
|
-
* .asLineChart()
|
|
42
|
-
* .addRange('A1:D6')
|
|
43
|
-
* .setPosition(1, 1, 0, 0)
|
|
44
|
-
* .setLineStyle('step')
|
|
45
|
-
* .build();
|
|
46
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
setLineStyle(lineStyle: AreaLineStyle): this;
|
|
50
|
-
/**
|
|
51
|
-
* The shape of the data point in the line chart.
|
|
52
|
-
* @param {LinePointShape} dataPointShape The shape of the data point in the line chart.
|
|
53
|
-
* @returns {LineChartBuilder} - The builder, for chaining.
|
|
54
|
-
*
|
|
55
|
-
* @example
|
|
56
|
-
* ```ts
|
|
57
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
58
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
59
|
-
*
|
|
60
|
-
* // Create a line chart with data source A1:D6.
|
|
61
|
-
* // The starting position is upper-left corner of cell B2.
|
|
62
|
-
* // The data point shape is set to circle, color is red, and size is 10.
|
|
63
|
-
* const chartInfo = fWorksheet.newChart()
|
|
64
|
-
* .asLineChart()
|
|
65
|
-
* .addRange('A1:D6')
|
|
66
|
-
* .setPosition(1, 1, 0, 0)
|
|
67
|
-
* .setDataPointShape(univerAPI.Enum.LinePointShape.CIRCLE)
|
|
68
|
-
* .setDataPointColor('#ff0000')
|
|
69
|
-
* .setDataPointSize(10)
|
|
70
|
-
* .build();
|
|
71
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
72
|
-
* ```
|
|
73
|
-
*/
|
|
74
|
-
setDataPointShape(dataPointShape: LinePointShape): this;
|
|
75
|
-
/**
|
|
76
|
-
* The color of the data point in the line chart.
|
|
77
|
-
* @param {string} dataPointColor The color of the data point in the line chart.
|
|
78
|
-
* @returns {LineChartBuilder} The builder, for chaining.
|
|
79
|
-
*
|
|
80
|
-
* @example
|
|
81
|
-
* ```ts
|
|
82
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
83
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
84
|
-
*
|
|
85
|
-
* // Create a line chart with data source A1:D6.
|
|
86
|
-
* // The starting position is upper-left corner of cell B2.
|
|
87
|
-
* // The data point shape is set to circle, color is red, and size is 10.
|
|
88
|
-
* const chartInfo = fWorksheet.newChart()
|
|
89
|
-
* .asLineChart()
|
|
90
|
-
* .addRange('A1:D6')
|
|
91
|
-
* .setPosition(1, 1, 0, 0)
|
|
92
|
-
* .setDataPointShape(univerAPI.Enum.LinePointShape.CIRCLE)
|
|
93
|
-
* .setDataPointColor('#ff0000')
|
|
94
|
-
* .setDataPointSize(10)
|
|
95
|
-
* .build();
|
|
96
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
97
|
-
* ```
|
|
98
|
-
*/
|
|
99
|
-
setDataPointColor(dataPointColor: string): this;
|
|
100
|
-
/**
|
|
101
|
-
* The size of the data point in the line chart.
|
|
102
|
-
* @param {number} dataPointSize The size of the data point in the line chart.
|
|
103
|
-
* @returns {LineChartBuilder} The builder, for chaining.
|
|
104
|
-
*
|
|
105
|
-
* @example
|
|
106
|
-
* ```ts
|
|
107
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
108
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
109
|
-
*
|
|
110
|
-
* // Create a line chart with data source A1:D6.
|
|
111
|
-
* // The starting position is upper-left corner of cell B2.
|
|
112
|
-
* // The data point shape is set to circle, color is red, and size is 10.
|
|
113
|
-
* const chartInfo = fWorksheet.newChart()
|
|
114
|
-
* .asLineChart()
|
|
115
|
-
* .addRange('A1:D6')
|
|
116
|
-
* .setPosition(1, 1, 0, 0)
|
|
117
|
-
* .setDataPointShape(univerAPI.Enum.LinePointShape.CIRCLE)
|
|
118
|
-
* .setDataPointColor('#ff0000')
|
|
119
|
-
* .setDataPointSize(10)
|
|
120
|
-
* .build();
|
|
121
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
122
|
-
* ```
|
|
123
|
-
*/
|
|
124
|
-
setDataPointSize(dataPointSize: number): this;
|
|
125
|
-
/**
|
|
126
|
-
* Builds the chart to reflect all changes made to it.
|
|
127
|
-
* @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).
|
|
128
|
-
* @returns {IChartBuilderInfo} The chart builder info.
|
|
129
|
-
*
|
|
130
|
-
* @example
|
|
131
|
-
* ```ts
|
|
132
|
-
* @example
|
|
133
|
-
* ```ts
|
|
134
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
135
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
136
|
-
*
|
|
137
|
-
* // Create a line chart with data source A1:D6.
|
|
138
|
-
* // The starting position is upper-left corner of cell B2.
|
|
139
|
-
* // The line style is set to the step type.
|
|
140
|
-
* // The data point shape is set to circle, color is red, and size is 10.
|
|
141
|
-
* const chartInfo = fWorksheet.newChart()
|
|
142
|
-
* .asLineChart()
|
|
143
|
-
* .addRange('A1:D6')
|
|
144
|
-
* .setPosition(1, 1, 0, 0)
|
|
145
|
-
* .setLineStyle('step')
|
|
146
|
-
* .setDataPointShape(univerAPI.Enum.LinePointShape.CIRCLE)
|
|
147
|
-
* .setDataPointColor('#ff0000')
|
|
148
|
-
* .setDataPointSize(10)
|
|
149
|
-
* .build();
|
|
150
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
build(): IChartBuilderInfo;
|
|
154
|
-
}
|
|
155
|
-
/**
|
|
156
|
-
* @ignore
|
|
157
|
-
*/
|
|
158
|
-
export declare class LineChartBuilderMixin extends FChartBuilderBase {
|
|
159
|
-
asLineChart(): LineChartBuilder;
|
|
160
|
-
}
|
|
@@ -1,189 +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.getActiveSheet();
|
|
25
|
-
*
|
|
26
|
-
* // Create a pie chart with data source A1:D6.
|
|
27
|
-
* // The starting position is upper-left corner of cell B2.
|
|
28
|
-
* // The doughnut hole is set to 0.5.
|
|
29
|
-
* const chartInfo = fWorksheet.newChart()
|
|
30
|
-
* .asPieChart()
|
|
31
|
-
* .addRange('A1:D6')
|
|
32
|
-
* .setPosition(1, 1, 0, 0)
|
|
33
|
-
* .setDoughnutHole(0.5)
|
|
34
|
-
* .build();
|
|
35
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
36
|
-
* ```
|
|
37
|
-
*/
|
|
38
|
-
setDoughnutHole(doughnutHole: number): this;
|
|
39
|
-
/**
|
|
40
|
-
* Sets the color of the border around the pie chart.
|
|
41
|
-
* @param {string} borderColor The color of the border around the pie chart.
|
|
42
|
-
* @returns {PieChartBuilder} this builder, for chaining.
|
|
43
|
-
*
|
|
44
|
-
* @example
|
|
45
|
-
* ```ts
|
|
46
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
47
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
48
|
-
*
|
|
49
|
-
* // Create a pie chart with data source A1:D6.
|
|
50
|
-
* // The starting position is upper-left corner of cell B2.
|
|
51
|
-
* // The border color is set to red.
|
|
52
|
-
* const chartInfo = fWorksheet.newChart()
|
|
53
|
-
* .asPieChart()
|
|
54
|
-
* .addRange('A1:D6')
|
|
55
|
-
* .setPosition(1, 1, 0, 0)
|
|
56
|
-
* .setBorderColor('#ff0000')
|
|
57
|
-
* .build();
|
|
58
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
59
|
-
* ```
|
|
60
|
-
*/
|
|
61
|
-
setBorderColor(borderColor: string): this;
|
|
62
|
-
/**
|
|
63
|
-
* Sets whether the pie chart has a padding angle.
|
|
64
|
-
* @param {boolean} hasPaddingAngle True if the pie chart has a padding angle; false otherwise.
|
|
65
|
-
* @returns {PieChartBuilder} this builder, for chaining.
|
|
66
|
-
*
|
|
67
|
-
* @example
|
|
68
|
-
* ```ts
|
|
69
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
70
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
71
|
-
*
|
|
72
|
-
* // Create a pie chart with data source A1:D6.
|
|
73
|
-
* // The starting position is upper-left corner of cell B2.
|
|
74
|
-
* // The pie chart has a padding angle.
|
|
75
|
-
* const chartInfo = fWorksheet.newChart()
|
|
76
|
-
* .asPieChart()
|
|
77
|
-
* .addRange('A1:D6')
|
|
78
|
-
* .setPosition(1, 1, 0, 0)
|
|
79
|
-
* .setHasPaddingAngle(true)
|
|
80
|
-
* .build();
|
|
81
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
82
|
-
* ```
|
|
83
|
-
*/
|
|
84
|
-
setHasPaddingAngle(hasPaddingAngle: boolean): this;
|
|
85
|
-
/**
|
|
86
|
-
* Sets whether the pie chart is a half pie chart.
|
|
87
|
-
* @param {boolean} isHalfPie True if the pie chart is a half pie chart; false otherwise.
|
|
88
|
-
* @returns {PieChartBuilder} this builder, for chaining.
|
|
89
|
-
*
|
|
90
|
-
* @example
|
|
91
|
-
* ```ts
|
|
92
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
93
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
94
|
-
*
|
|
95
|
-
* // Create a pie chart with data source A1:D6.
|
|
96
|
-
* // The starting position is upper-left corner of cell B2.
|
|
97
|
-
* // The pie chart is a half pie chart.
|
|
98
|
-
* const chartInfo = fWorksheet.newChart()
|
|
99
|
-
* .asPieChart()
|
|
100
|
-
* .addRange('A1:D6')
|
|
101
|
-
* .setPosition(1, 1, 0, 0)
|
|
102
|
-
* .setIsHalfPie(true)
|
|
103
|
-
* .build();
|
|
104
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
105
|
-
* ```
|
|
106
|
-
*/
|
|
107
|
-
setIsHalfPie(isHalfPie: boolean): this;
|
|
108
|
-
/**
|
|
109
|
-
* Sets whether the pie chart is a rose pie chart.
|
|
110
|
-
* @param {boolean} rosePie True if the pie chart is a rose pie chart; false otherwise.
|
|
111
|
-
* @returns {PieChartBuilder} this builder, for chaining.
|
|
112
|
-
*
|
|
113
|
-
* @example
|
|
114
|
-
* ```ts
|
|
115
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
116
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
117
|
-
*
|
|
118
|
-
* // Create a pie chart with data source A1:D6.
|
|
119
|
-
* // The starting position is upper-left corner of cell B2.
|
|
120
|
-
* // The pie chart is a rose pie chart.
|
|
121
|
-
* const chartInfo = fWorksheet.newChart()
|
|
122
|
-
* .asPieChart()
|
|
123
|
-
* .addRange('A1:D6')
|
|
124
|
-
* .setPosition(1, 1, 0, 0)
|
|
125
|
-
* .setRosePie(true)
|
|
126
|
-
* .build();
|
|
127
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
128
|
-
* ```
|
|
129
|
-
*/
|
|
130
|
-
setRosePie(rosePie: boolean): this;
|
|
131
|
-
/**
|
|
132
|
-
* Sets whether the pie chart shows label lines.
|
|
133
|
-
* @param {boolean} showLabelLine True if the pie chart shows label lines; false otherwise.
|
|
134
|
-
* @returns {PieChartBuilder} this builder, for chaining.
|
|
135
|
-
*
|
|
136
|
-
* @example
|
|
137
|
-
* ```ts
|
|
138
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
139
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
140
|
-
*
|
|
141
|
-
* // Create a pie chart with data source A1:D6.
|
|
142
|
-
* // The starting position is upper-left corner of cell B2.
|
|
143
|
-
* // The pie chart does not show label lines.
|
|
144
|
-
* const chartInfo = fWorksheet.newChart()
|
|
145
|
-
* .asPieChart()
|
|
146
|
-
* .addRange('A1:D6')
|
|
147
|
-
* .setPosition(1, 1, 0, 0)
|
|
148
|
-
* .setShowLabelLine(false)
|
|
149
|
-
* .build();
|
|
150
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
151
|
-
* ```
|
|
152
|
-
*/
|
|
153
|
-
setShowLabelLine(showLabelLine: boolean): this;
|
|
154
|
-
/**
|
|
155
|
-
* Builds the chart to reflect all changes made to it.
|
|
156
|
-
* @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).
|
|
157
|
-
* @returns {IChartBuilderInfo} The chart builder info.
|
|
158
|
-
*
|
|
159
|
-
* @example
|
|
160
|
-
* ```ts
|
|
161
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
162
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
163
|
-
*
|
|
164
|
-
* // Create a pie chart with data source A1:D6.
|
|
165
|
-
* // The starting position is upper-left corner of cell B2.
|
|
166
|
-
* // The doughnut hole is set to 0.5.
|
|
167
|
-
* // The border color is set to red.
|
|
168
|
-
* // The pie chart has a padding angle.
|
|
169
|
-
* // The pie chart is a half pie chart.
|
|
170
|
-
* const chartInfo = fWorksheet.newChart()
|
|
171
|
-
* .asPieChart()
|
|
172
|
-
* .addRange('A1:D6')
|
|
173
|
-
* .setPosition(1, 1, 0, 0)
|
|
174
|
-
* .setDoughnutHole(0.5)
|
|
175
|
-
* .setBorderColor('#ff0000')
|
|
176
|
-
* .setHasPaddingAngle(true)
|
|
177
|
-
* .setIsHalfPie(true)
|
|
178
|
-
* .build();
|
|
179
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
180
|
-
* ```
|
|
181
|
-
*/
|
|
182
|
-
build(): IChartBuilderInfo;
|
|
183
|
-
}
|
|
184
|
-
/**
|
|
185
|
-
* @ignore
|
|
186
|
-
*/
|
|
187
|
-
export declare class PieChartBuilderMixin extends FChartBuilderBase {
|
|
188
|
-
asPieChart(): PieChartBuilder;
|
|
189
|
-
}
|
|
@@ -1,97 +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.getActiveSheet();
|
|
28
|
-
*
|
|
29
|
-
* // Create a radar chart with data source A1:D6.
|
|
30
|
-
* // The starting position is upper-left corner of cell B2.
|
|
31
|
-
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
32
|
-
* const chartInfo = fWorksheet.newChart()
|
|
33
|
-
* .asRadarChart()
|
|
34
|
-
* .addRange('A1:D6')
|
|
35
|
-
* .setPosition(1, 1, 0, 0)
|
|
36
|
-
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
37
|
-
* .setFill(true)
|
|
38
|
-
* .build();
|
|
39
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
40
|
-
* ```
|
|
41
|
-
*/
|
|
42
|
-
setShape(shape: RadarShape): this;
|
|
43
|
-
/**
|
|
44
|
-
* Sets whether the radar chart is filled.
|
|
45
|
-
* @param {boolean} fill True if the radar chart is filled; false otherwise.
|
|
46
|
-
* @returns {RadarChartBuilder} this builder, for chaining.
|
|
47
|
-
*
|
|
48
|
-
* @example
|
|
49
|
-
* ```ts
|
|
50
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
51
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
52
|
-
*
|
|
53
|
-
* // Create a radar chart with data source A1:D6.
|
|
54
|
-
* // The starting position is upper-left corner of cell B2.
|
|
55
|
-
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
56
|
-
* const chartInfo = fWorksheet.newChart()
|
|
57
|
-
* .asRadarChart()
|
|
58
|
-
* .addRange('A1:D6')
|
|
59
|
-
* .setPosition(1, 1, 0, 0)
|
|
60
|
-
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
61
|
-
* .setFill(true)
|
|
62
|
-
* .build();
|
|
63
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
64
|
-
* ```
|
|
65
|
-
*/
|
|
66
|
-
setFill(fill: boolean): this;
|
|
67
|
-
/**
|
|
68
|
-
* Builds the chart to reflect all changes made to it.
|
|
69
|
-
* @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).
|
|
70
|
-
* @returns {IChartBuilderInfo} The chart builder info.
|
|
71
|
-
*
|
|
72
|
-
* @example
|
|
73
|
-
* ```ts
|
|
74
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
75
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
76
|
-
*
|
|
77
|
-
* // Create a radar chart with data source A1:D6.
|
|
78
|
-
* // The starting position is upper-left corner of cell B2.
|
|
79
|
-
* // The shape of the radar chart is set to polygon and filled with red color.
|
|
80
|
-
* const chartInfo = fWorksheet.newChart()
|
|
81
|
-
* .asRadarChart()
|
|
82
|
-
* .addRange('A1:D6')
|
|
83
|
-
* .setPosition(1, 1, 0, 0)
|
|
84
|
-
* .setShape(univerAPI.Enum.RadarShape.Polygon)
|
|
85
|
-
* .setFill(true)
|
|
86
|
-
* .build();
|
|
87
|
-
* await fWorksheet.insertChart(chartInfo);
|
|
88
|
-
* ```
|
|
89
|
-
*/
|
|
90
|
-
build(): IChartBuilderInfo;
|
|
91
|
-
}
|
|
92
|
-
/**
|
|
93
|
-
* @ignore
|
|
94
|
-
*/
|
|
95
|
-
export declare class RadarChartBuilderMixin extends FChartBuilderBase {
|
|
96
|
-
asRadarChart(): RadarChartBuilder;
|
|
97
|
-
}
|
|
@@ -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,127 +0,0 @@
|
|
|
1
|
-
import type { IChartDataCategory, IChartDataSeries } from '@univerjs-pro/engine-chart';
|
|
2
|
-
import type { ISheetChartSourceSingleRange } from '@univerjs-pro/sheets-chart';
|
|
3
|
-
import type { Injector } from '@univerjs/core';
|
|
4
|
-
import { FChartBuilderBase } from './chart-builder/chart-builder-base';
|
|
5
|
-
/**
|
|
6
|
-
* The facade class for the chart.
|
|
7
|
-
* @hideconstructor
|
|
8
|
-
*/
|
|
9
|
-
export declare class FChart {
|
|
10
|
-
/**
|
|
11
|
-
* @ignore
|
|
12
|
-
*/
|
|
13
|
-
unitId: string;
|
|
14
|
-
/**
|
|
15
|
-
* @ignore
|
|
16
|
-
*/
|
|
17
|
-
subUnitId: string;
|
|
18
|
-
/**
|
|
19
|
-
* @ignore
|
|
20
|
-
*/
|
|
21
|
-
chartId: string;
|
|
22
|
-
private _injector;
|
|
23
|
-
constructor(unitId: string, subUnitId: string, chartId: string, injector: Injector);
|
|
24
|
-
/**
|
|
25
|
-
* Get the chart id.
|
|
26
|
-
* @returns {string} The chart id.
|
|
27
|
-
*
|
|
28
|
-
* @example
|
|
29
|
-
* ```ts
|
|
30
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
31
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
32
|
-
* const charts = fWorksheet.getCharts();
|
|
33
|
-
* console.log(charts[0]?.getChartId());
|
|
34
|
-
* ```
|
|
35
|
-
*/
|
|
36
|
-
getChartId(): string;
|
|
37
|
-
/**
|
|
38
|
-
* Get the range of the chart.
|
|
39
|
-
* @returns {ISheetChartSourceSingleRange|undefined} The range of the chart.
|
|
40
|
-
*
|
|
41
|
-
* @example
|
|
42
|
-
* ```ts
|
|
43
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
44
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
45
|
-
* const charts = fWorksheet.getCharts();
|
|
46
|
-
* console.log(charts[0]?.getRange());
|
|
47
|
-
* ```
|
|
48
|
-
*/
|
|
49
|
-
getRange(): ISheetChartSourceSingleRange | undefined;
|
|
50
|
-
/**
|
|
51
|
-
* Update the range info of the chart. The range info includes the range of the chart and the direction in source.
|
|
52
|
-
* @param {ISheetChartSourceSingleRange} rangeInfo The new range of the chart.
|
|
53
|
-
* @param {IRange} rangeInfo.range.range The new range of the chart.
|
|
54
|
-
* @param {string} rangeInfo.range.subUnitId The new sheet id of the chart.
|
|
55
|
-
* @param {string} rangeInfo.range.unitId The new workbook id of the chart.
|
|
56
|
-
* @param {boolean} [rangeInfo.isRowDirection] Is treat row as category.
|
|
57
|
-
* @returns {Promise<boolean>} Whether the update is successful.
|
|
58
|
-
*
|
|
59
|
-
* @example
|
|
60
|
-
* ```ts
|
|
61
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
62
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
63
|
-
*
|
|
64
|
-
* // Get all charts on the active sheet.
|
|
65
|
-
* const charts = fWorksheet.getCharts();
|
|
66
|
-
*
|
|
67
|
-
* // Switch chart row direction
|
|
68
|
-
* if (charts.length > 0){
|
|
69
|
-
* const rangeInfo = { ...charts[0].getRange() };
|
|
70
|
-
* rangeInfo.isRowDirection = !rangeInfo.isRowDirection;
|
|
71
|
-
* charts[0].updateRange(rangeInfo);
|
|
72
|
-
* }
|
|
73
|
-
* ```
|
|
74
|
-
*/
|
|
75
|
-
updateRange(rangeInfo: ISheetChartSourceSingleRange): Promise<boolean>;
|
|
76
|
-
/**
|
|
77
|
-
* Get the series data list of the chart.
|
|
78
|
-
* @typedef ChartSeriesData
|
|
79
|
-
* @property {string} name The name of the series.
|
|
80
|
-
* @property {number} index The index of the series.
|
|
81
|
-
* @property {ChartSeriesItem[]} items The data of the series.
|
|
82
|
-
* @property {number} items.value The value of the series.
|
|
83
|
-
* @property {string} items.label The label of the series.
|
|
84
|
-
* @returns {IChartDataSeries[]|undefined} The series data list of the chart.
|
|
85
|
-
*
|
|
86
|
-
* @example
|
|
87
|
-
* ```ts
|
|
88
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
89
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
90
|
-
* const charts = fWorksheet.getCharts();
|
|
91
|
-
* if (charts.length > 0){
|
|
92
|
-
* const seriesData = charts[0].getSeriesData();
|
|
93
|
-
* console.log(seriesData);
|
|
94
|
-
* }
|
|
95
|
-
* ```
|
|
96
|
-
*/
|
|
97
|
-
getSeriesData(): IChartDataSeries[] | undefined;
|
|
98
|
-
/**
|
|
99
|
-
* Get the category data of the chart.
|
|
100
|
-
* @type ChartCategoryData
|
|
101
|
-
* @property {string} name The name of the category.
|
|
102
|
-
* @property {number} index The index of the category.
|
|
103
|
-
* @property {CategoryType} type The type of the category.
|
|
104
|
-
* @property {string[]} keys The keys of the category.
|
|
105
|
-
* @property {IChartDataItem[]} items The data of the category.
|
|
106
|
-
* @property {number} items.value The value of the category.
|
|
107
|
-
* @property {string} items.label The label of the category.
|
|
108
|
-
* @returns The category data of the chart.
|
|
109
|
-
*
|
|
110
|
-
* @example
|
|
111
|
-
* ```ts
|
|
112
|
-
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
113
|
-
* const fWorksheet = fWorkbook.getActiveSheet();
|
|
114
|
-
* const charts = fWorksheet.getCharts();
|
|
115
|
-
* if (charts.length > 0){
|
|
116
|
-
* const categoryData = charts[0].getCategoryData();
|
|
117
|
-
* console.log(categoryData);
|
|
118
|
-
* }
|
|
119
|
-
* ```
|
|
120
|
-
*/
|
|
121
|
-
getCategoryData(): IChartDataCategory | undefined;
|
|
122
|
-
/**
|
|
123
|
-
* Returns a new FChartBuilderBase instance that modifies this chart.
|
|
124
|
-
* @returns {FChartBuilderBase} The new FChartBuilderBase instance.
|
|
125
|
-
*/
|
|
126
|
-
modify(): FChartBuilderBase;
|
|
127
|
-
}
|