@univerjs-pro/engine-chart 1.0.0-beta.0 → 1.0.0-beta.1
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 +9 -0
- 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/chart-builder-adapter.d.ts +1 -3
- package/lib/types/chart-builder/chart-builder.d.ts +2 -5
- package/lib/types/chart-builder/chart-live-adapter.d.ts +15 -0
- package/lib/types/chart-builder/chart-types.d.ts +17 -0
- package/lib/types/chart-builder/configuration/cartesian-series.d.ts +1 -0
- package/lib/types/chart-builder/configuration/chart-config-group.d.ts +38 -0
- package/lib/types/chart-builder/configuration/chart-config-operation.d.ts +1 -38
- package/lib/types/chart-builder/configuration/gauge.d.ts +1 -1
- package/lib/types/chart-builder/conversion/chart-config-converter.d.ts +24 -11
- package/lib/types/chart-builder/conversion/chart-create-config.d.ts +6 -0
- package/lib/types/chart-builder/conversion/chart-model-fields.d.ts +17 -0
- package/lib/types/chart-builder/conversion/describe-chart-model.d.ts +0 -127
- package/lib/types/chart-builder/detached-chart-builder-adapter.d.ts +1 -10
- package/lib/types/chart-builder/internal/apply-pending-to-description.d.ts +2 -0
- package/lib/types/chart-builder/internal/chart-host-config-adapter.d.ts +3 -0
- package/lib/types/chart-builder/internal/chart-pending-patch.d.ts +11 -0
- package/lib/types/chart-builder/internal/patch-interpreter.d.ts +17 -0
- package/lib/types/facade/builders/f-area-chart-builder.d.ts +52 -7
- package/lib/types/facade/builders/f-boxplot-chart-builder.d.ts +88 -3
- package/lib/types/facade/builders/f-bubble-chart-builder.d.ts +59 -6
- package/lib/types/facade/builders/f-candlestick-chart-builder.d.ts +90 -31
- package/lib/types/facade/builders/f-chord-chart-builder.d.ts +180 -8
- package/lib/types/facade/builders/f-combination-chart-builder.d.ts +55 -10
- package/lib/types/facade/builders/f-funnel-chart-builder.d.ts +55 -9
- package/lib/types/facade/builders/f-gauge-chart-builder.d.ts +378 -10
- package/lib/types/facade/builders/f-heatmap-chart-builder.d.ts +83 -26
- package/lib/types/facade/builders/f-histogram-chart-builder.d.ts +142 -16
- package/lib/types/facade/builders/f-line-chart-builder.d.ts +51 -6
- package/lib/types/facade/builders/f-pareto-chart-builder.d.ts +83 -20
- package/lib/types/facade/builders/f-pie-chart-builder.d.ts +131 -47
- package/lib/types/facade/builders/f-radar-chart-builder.d.ts +64 -11
- package/lib/types/facade/builders/f-relation-chart-builder.d.ts +72 -38
- package/lib/types/facade/builders/f-scatter-chart-builder.d.ts +58 -6
- package/lib/types/facade/builders/f-sunburst-chart-builder.d.ts +122 -8
- package/lib/types/facade/builders/f-treemap-chart-builder.d.ts +115 -13
- package/lib/types/facade/builders/f-waterfall-chart-builder.d.ts +87 -53
- package/lib/types/facade/builders/f-word-cloud-chart-builder.d.ts +64 -15
- package/lib/types/facade/chart-builder-registry.d.ts +4 -4
- package/lib/types/facade/chart-builder-type-map.d.ts +35 -32
- package/lib/types/facade/chart-host-builder-types.d.ts +2 -21
- package/lib/types/facade/create-chart-builder.d.ts +46 -0
- package/lib/types/facade/f-axis-chart-builder.d.ts +21 -38
- package/lib/types/facade/f-cartesian-chart-builder.d.ts +32 -20
- package/lib/types/facade/f-chart-builder-base.d.ts +202 -73
- package/lib/types/facade/f-chart.d.ts +652 -0
- package/lib/types/facade/f-enum.d.ts +684 -31
- package/lib/types/facade/f-univer.d.ts +51 -0
- package/lib/types/facade/index.d.ts +7 -9
- package/lib/types/facade/internal/chart-builder-facade-context.d.ts +11 -10
- package/lib/types/index.d.ts +25 -15
- package/lib/types/models/chart-context/resolve-chart-context.d.ts +3 -0
- package/lib/types/models/chart-data/chart-field-consumption-validator.d.ts +1 -1
- package/lib/types/models/chart-host/config/chart-config-interpreter.d.ts +13 -0
- package/lib/types/models/chart-host/resource/chart-data-source-resolver.d.ts +58 -0
- package/lib/types/models/chart-host/resource/chart-resource-repository.d.ts +111 -0
- package/lib/types/models/chart-host/resource/chart-resource-serializer.d.ts +2 -1
- package/lib/types/models/chart-host/resource/inline-chart-table.d.ts +4 -3
- package/lib/types/models/chart-host/resource/persisted-chart-style.d.ts +3 -0
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.adapter.d.ts +22 -0
- package/lib/types/models/chart-host/resource/resource-ref-chart-data-source.provider.d.ts +12 -0
- package/lib/types/models/chart-host/static/chart-model-store.d.ts +56 -0
- package/lib/types/models/chart-host/static/{static-chart-runtime.d.ts → chart-runtime.d.ts} +6 -5
- package/lib/types/models/chart-model/chart-model.d.ts +2 -383
- package/lib/types/models/chart-render/axes/chart-runtime-axes.d.ts +2 -2
- package/lib/types/models/chart-render/chart-render-input-resolver.d.ts +2 -2
- package/lib/types/models/chart-render/converter/converters/gauge-chart-converter.d.ts +5 -3
- package/lib/types/models/chart-render/converter/echart-text-overflow.d.ts +7 -0
- package/lib/types/models/chart-render/converter/render-spec-operators/grid-operator.d.ts +3 -3
- package/lib/types/models/chart-render/converter/render-spec-operators/legend-size.d.ts +1 -2
- package/lib/types/models/chart-render/converter/render-spec-operators/series-style-operator/series-style-operator.d.ts +2 -2
- package/lib/types/models/chart-render/converter/render-spec-operators/tool-tip-operator.d.ts +3 -13
- package/lib/types/models/chart-render/converter/render-spec-operators/tools.d.ts +4 -4
- package/lib/types/models/chart-render/converter/render-spec-operators/visual-map-operator.d.ts +4 -0
- package/lib/types/models/chart-render/echart-render-model.d.ts +7 -0
- package/lib/types/models/chart-render/edit-overlay/chart-element-edit-overlay.d.ts +1 -1
- package/lib/types/models/chart-render/edit-overlay/resolve-chart-element-hit-layout.d.ts +1 -1
- package/lib/types/models/chart-render/style/chart-runtime-style.d.ts +0 -1
- package/lib/types/models/common/constants/default-chart-style.d.ts +53 -53
- package/lib/types/models/common/constants/default.d.ts +3 -2
- package/lib/types/plugin.d.ts +1 -1
- package/lib/types/types.d.ts +2 -4
- package/lib/types/utils/compact.d.ts +6 -0
- 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 +6 -5
- package/lib/types/chart-builder/internal/host-builder-runtime.d.ts +0 -3
- package/lib/types/chart-builder/internal/merge-description.d.ts +0 -2
- package/lib/types/facade/f-chart-base.d.ts +0 -82
- package/lib/types/facade/f-charts-base.d.ts +0 -74
- package/lib/types/facade/internal/host-builder-composer.d.ts +0 -16
- package/lib/types/models/chart-host/resource/static-chart-resource-repository.d.ts +0 -75
- package/lib/types/models/chart-host/static/static-chart-model-store.d.ts +0 -43
|
@@ -1,5 +1,90 @@
|
|
|
1
|
-
import type { IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { IChartInfo, IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Boxplot keeps its existing automatic preset but does not expose explicit gradients.
|
|
5
|
+
*
|
|
6
|
+
* Each selected numeric field is one distribution and must contain its raw samples.
|
|
7
|
+
* The renderer calculates the five-number summary; do not supply precomputed
|
|
8
|
+
* Min/Q1/Median/Q3/Max rows. Field headers become distribution labels.
|
|
9
|
+
*
|
|
10
|
+
* @example Sheet
|
|
11
|
+
* ```ts
|
|
12
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
13
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
14
|
+
* fWorksheet.getRange('A1:C6').setValues([
|
|
15
|
+
* ['Group A', 'Group B', 'Group C'],
|
|
16
|
+
* [12, 18, 9],
|
|
17
|
+
* [15, 20, 13],
|
|
18
|
+
* [19, 24, 16],
|
|
19
|
+
* [22, 28, 21],
|
|
20
|
+
* [25, 31, 24],
|
|
21
|
+
* ]);
|
|
22
|
+
* const chartInfo = fWorksheet
|
|
23
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Boxplot)
|
|
24
|
+
* .setSource({
|
|
25
|
+
* range: 'A1:C6',
|
|
26
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
27
|
+
* })
|
|
28
|
+
* .setValueFields([0, 1, 2])
|
|
29
|
+
* .setTitle('Distribution')
|
|
30
|
+
* .build();
|
|
31
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
32
|
+
* ```
|
|
33
|
+
*
|
|
34
|
+
* @example Doc
|
|
35
|
+
* ```ts
|
|
36
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
37
|
+
* const chartInfo = fDocument
|
|
38
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Boxplot)
|
|
39
|
+
* .setSource([
|
|
40
|
+
* ['Group A', 'Group B'],
|
|
41
|
+
* [12, 18],
|
|
42
|
+
* [15, 20],
|
|
43
|
+
* [19, 24],
|
|
44
|
+
* [22, 28]
|
|
45
|
+
* ])
|
|
46
|
+
* .setValueFields([0, 1])
|
|
47
|
+
* .setTitle('Distribution')
|
|
48
|
+
* .build();
|
|
49
|
+
* await fDocument.insertChart(chartInfo);
|
|
50
|
+
* ```
|
|
51
|
+
*
|
|
52
|
+
* @example Slide
|
|
53
|
+
* ```ts
|
|
54
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
55
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
56
|
+
* const chartInfo = fSlide
|
|
57
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Boxplot)
|
|
58
|
+
* .setSource([
|
|
59
|
+
* ['Group A', 'Group B'],
|
|
60
|
+
* [12, 18],
|
|
61
|
+
* [15, 20],
|
|
62
|
+
* [19, 24],
|
|
63
|
+
* [22, 28]
|
|
64
|
+
* ])
|
|
65
|
+
* .setValueFields([0, 1])
|
|
66
|
+
* .setTitle('Distribution')
|
|
67
|
+
* .build();
|
|
68
|
+
* await fSlide.insertChart(chartInfo);
|
|
69
|
+
* ```
|
|
70
|
+
*
|
|
71
|
+
* @example Board
|
|
72
|
+
* ```ts
|
|
73
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
74
|
+
* const chartInfo = fBoard
|
|
75
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Boxplot)
|
|
76
|
+
* .setSource([
|
|
77
|
+
* ['Group A', 'Group B'],
|
|
78
|
+
* [12, 18],
|
|
79
|
+
* [15, 20],
|
|
80
|
+
* [19, 24],
|
|
81
|
+
* [22, 28]
|
|
82
|
+
* ])
|
|
83
|
+
* .setValueFields([0, 1])
|
|
84
|
+
* .setTitle('Distribution')
|
|
85
|
+
* .build();
|
|
86
|
+
* await fBoard.insertChart(chartInfo);
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
89
|
+
export declare class FBoxplotChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FCartesianChartBuilder<Omit<IChartSolidSeriesPatch, 'selector'>, IChartSolidSeriesStyleSpec, TSource, TDataSource, TInfo> {
|
|
5
90
|
}
|
|
@@ -1,6 +1,63 @@
|
|
|
1
|
-
import type { IChartBubbleMappingSpec, IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { IChartBubbleMappingSpec, IChartInfo, IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fluent, type-specific Builder for Bubble Charts.
|
|
5
|
+
*
|
|
6
|
+
* The data source is an observation table: each row represents one bubble. X and Y
|
|
7
|
+
* must map to numeric fields. Size is an optional numeric field; label and series are
|
|
8
|
+
* optional categorical fields for point labels and grouping. All mapped fields are
|
|
9
|
+
* aligned by row, so their source vectors must have the same length.
|
|
10
|
+
*
|
|
11
|
+
* @example Sheet
|
|
12
|
+
* ```ts
|
|
13
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
14
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
15
|
+
* const chartInfo = fWorksheet
|
|
16
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Bubble)
|
|
17
|
+
* .setSource({
|
|
18
|
+
* range: 'A1:E8',
|
|
19
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
20
|
+
* })
|
|
21
|
+
* .setBubbleMapping({ xIndex: 0, yIndex: 1, sizeIndex: 2, labelIndex: 3, seriesIndex: 4 })
|
|
22
|
+
* .build();
|
|
23
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
24
|
+
* ```
|
|
25
|
+
*
|
|
26
|
+
* @example Doc
|
|
27
|
+
* ```ts
|
|
28
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
29
|
+
* const chartInfo = fDocument
|
|
30
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Bubble)
|
|
31
|
+
* .setSource([['X', 'Y', 'Size'], [10, 20, 5], [18, 32, 9]])
|
|
32
|
+
* .setBubbleMapping({ xIndex: 0, yIndex: 1, sizeIndex: 2 })
|
|
33
|
+
* .build();
|
|
34
|
+
* await fDocument.insertChart(chartInfo);
|
|
35
|
+
* ```
|
|
36
|
+
*
|
|
37
|
+
* @example Slide
|
|
38
|
+
* ```ts
|
|
39
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
40
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
41
|
+
* const chartInfo = fSlide
|
|
42
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Bubble)
|
|
43
|
+
* .setSource([['X', 'Y', 'Size'], [10, 20, 5], [18, 32, 9]])
|
|
44
|
+
* .setBubbleMapping({ xIndex: 0, yIndex: 1, sizeIndex: 2 })
|
|
45
|
+
* .build();
|
|
46
|
+
* await fSlide.insertChart(chartInfo);
|
|
47
|
+
* ```
|
|
48
|
+
*
|
|
49
|
+
* @example Board
|
|
50
|
+
* ```ts
|
|
51
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
52
|
+
* const chartInfo = fBoard
|
|
53
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Bubble)
|
|
54
|
+
* .setSource([['X', 'Y', 'Size'], [10, 20, 5], [18, 32, 9]])
|
|
55
|
+
* .setBubbleMapping({ xIndex: 0, yIndex: 1, sizeIndex: 2 })
|
|
56
|
+
* .build();
|
|
57
|
+
* await fBoard.insertChart(chartInfo);
|
|
58
|
+
* ```
|
|
59
|
+
*/
|
|
60
|
+
export declare class FBubbleChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FCartesianChartBuilder<Omit<IChartSolidSeriesPatch, 'selector'>, IChartSolidSeriesStyleSpec, TSource, TDataSource, TInfo> {
|
|
4
61
|
/**
|
|
5
62
|
* Sets the bubble mapping configuration and returns this builder for chaining.
|
|
6
63
|
*
|
|
@@ -10,8 +67,6 @@ export declare class FBubbleChartBuilder extends FCartesianChartBuilder<Omit<ICh
|
|
|
10
67
|
* @returns This builder for chaining.
|
|
11
68
|
* @example
|
|
12
69
|
* ```ts
|
|
13
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
14
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Bubble);
|
|
15
70
|
* builder.setBubbleMapping({ xIndex: 0, yIndex: 1, sizeIndex: 2 });
|
|
16
71
|
* ```
|
|
17
72
|
*/
|
|
@@ -24,8 +79,6 @@ export declare class FBubbleChartBuilder extends FCartesianChartBuilder<Omit<ICh
|
|
|
24
79
|
* @returns This builder for chaining.
|
|
25
80
|
* @example
|
|
26
81
|
* ```ts
|
|
27
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
28
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Bubble);
|
|
29
82
|
* builder.clearBubbleMapping();
|
|
30
83
|
* ```
|
|
31
84
|
*/
|
|
@@ -1,24 +1,97 @@
|
|
|
1
|
-
import type { IChartCandlestickMappingSpec, IChartCandlestickStateStyleSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { IChartCandlestickMappingSpec, IChartCandlestickStateStyleSpec, IChartInfo } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FAxisChartBuilder } from '../f-axis-chart-builder';
|
|
3
|
-
/**
|
|
4
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fluent semantic builder for a single OHLC Candlestick series.
|
|
5
|
+
*
|
|
6
|
+
* Each source row represents one trading interval. Map one category field and four
|
|
7
|
+
* distinct numeric fields in Open, High, Low, Close order. A row with any missing or
|
|
8
|
+
* non-finite OHLC value renders as a gap rather than a partial candle.
|
|
9
|
+
*
|
|
10
|
+
* @example Sheet
|
|
11
|
+
* ```ts
|
|
12
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
13
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
14
|
+
* const chartInfo = fWorksheet
|
|
15
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
16
|
+
* .setSource({
|
|
17
|
+
* range: 'A1:E8',
|
|
18
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
19
|
+
* })
|
|
20
|
+
* .setCategoryField(0)
|
|
21
|
+
* .setCandlestickFields({ openIndex: 1, highIndex: 2, lowIndex: 3, closeIndex: 4 })
|
|
22
|
+
* .setRisingStyle({ color: '#0DA471', hollow: true })
|
|
23
|
+
* .setFallingStyle({ color: '#F05252' })
|
|
24
|
+
* .setDojiStyle({ color: '#8C8C8C', border: { width: 2 } })
|
|
25
|
+
* .setCandleWidth(18)
|
|
26
|
+
* .build();
|
|
27
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
28
|
+
* ```
|
|
29
|
+
*
|
|
30
|
+
* @example Doc
|
|
31
|
+
* ```ts
|
|
32
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
33
|
+
* const chartInfo = fDocument
|
|
34
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
35
|
+
* .setSource([['Date', 'Open', 'High', 'Low', 'Close'], ['Mon', 100, 112, 96, 108], ['Tue', 108, 116, 102, 105]])
|
|
36
|
+
* .setCategoryField(0)
|
|
37
|
+
* .setCandlestickFields({ openIndex: 1, highIndex: 2, lowIndex: 3, closeIndex: 4 })
|
|
38
|
+
* .setRisingStyle({ color: '#0DA471', hollow: true })
|
|
39
|
+
* .setFallingStyle({ color: '#F05252' })
|
|
40
|
+
* .setDojiStyle({ color: '#8C8C8C', border: { width: 2 } })
|
|
41
|
+
* .setCandleWidth(18)
|
|
42
|
+
* .build();
|
|
43
|
+
* await fDocument.insertChart(chartInfo);
|
|
44
|
+
* ```
|
|
45
|
+
*
|
|
46
|
+
* @example Slide
|
|
47
|
+
* ```ts
|
|
48
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
49
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
50
|
+
* const chartInfo = fSlide
|
|
51
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
52
|
+
* .setSource([['Date', 'Open', 'High', 'Low', 'Close'], ['Mon', 100, 112, 96, 108], ['Tue', 108, 116, 102, 105]])
|
|
53
|
+
* .setCategoryField(0)
|
|
54
|
+
* .setCandlestickFields({ openIndex: 1, highIndex: 2, lowIndex: 3, closeIndex: 4 })
|
|
55
|
+
* .setRisingStyle({ color: '#0DA471', hollow: true })
|
|
56
|
+
* .setFallingStyle({ color: '#F05252' })
|
|
57
|
+
* .setDojiStyle({ color: '#8C8C8C', border: { width: 2 } })
|
|
58
|
+
* .setCandleWidth(18)
|
|
59
|
+
* .build();
|
|
60
|
+
* await fSlide.insertChart(chartInfo);
|
|
61
|
+
* ```
|
|
62
|
+
*
|
|
63
|
+
* @example Board
|
|
64
|
+
* ```ts
|
|
65
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
66
|
+
* const chartInfo = fBoard
|
|
67
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
68
|
+
* .setSource([['Date', 'Open', 'High', 'Low', 'Close'], ['Mon', 100, 112, 96, 108], ['Tue', 108, 116, 102, 105]])
|
|
69
|
+
* .setCategoryField(0)
|
|
70
|
+
* .setCandlestickFields({ openIndex: 1, highIndex: 2, lowIndex: 3, closeIndex: 4 })
|
|
71
|
+
* .setRisingStyle({ color: '#0DA471', hollow: true })
|
|
72
|
+
* .setFallingStyle({ color: '#F05252' })
|
|
73
|
+
* .setDojiStyle({ color: '#8C8C8C', border: { width: 2 } })
|
|
74
|
+
* .setCandleWidth(18)
|
|
75
|
+
* .build();
|
|
76
|
+
* await fBoard.insertChart(chartInfo);
|
|
77
|
+
* ```
|
|
78
|
+
*/
|
|
79
|
+
export declare class FCandlestickChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FAxisChartBuilder<TSource, TDataSource, TInfo> {
|
|
5
80
|
/**
|
|
6
81
|
* Replaces Open, High, Low, and Close source fields atomically.
|
|
7
82
|
*
|
|
8
83
|
* Category remains configured through `setCategoryField()`. Every supplied index must be a
|
|
9
84
|
* unique non-negative integer. Read the pending or persisted value with
|
|
10
|
-
* `builder.
|
|
85
|
+
* `builder.build().config.mapping?.candlestick`.
|
|
11
86
|
*
|
|
12
87
|
* @param fields Required semantic OHLC source field indexes.
|
|
13
88
|
* @returns This builder for chaining.
|
|
14
89
|
* @example
|
|
15
90
|
* ```ts
|
|
16
|
-
*
|
|
17
|
-
* const builder = worksheet.charts.create()
|
|
18
|
-
* .setType(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
91
|
+
* builder
|
|
19
92
|
* .setCategoryField(0)
|
|
20
93
|
* .setCandlestickFields({ openIndex: 1, highIndex: 2, lowIndex: 3, closeIndex: 4 });
|
|
21
|
-
* const mapping = builder.
|
|
94
|
+
* const mapping = builder.build().config.mapping?.candlestick;
|
|
22
95
|
* ```
|
|
23
96
|
*/
|
|
24
97
|
setCandlestickFields(fields: IChartCandlestickMappingSpec): this;
|
|
@@ -28,10 +101,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
28
101
|
* @returns This builder for chaining.
|
|
29
102
|
* @example
|
|
30
103
|
* ```ts
|
|
31
|
-
*
|
|
32
|
-
* worksheet.charts.create()
|
|
33
|
-
* .setType(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
34
|
-
* .clearCandlestickFields();
|
|
104
|
+
* builder.clearCandlestickFields();
|
|
35
105
|
* ```
|
|
36
106
|
*/
|
|
37
107
|
clearCandlestickFields(): this;
|
|
@@ -42,9 +112,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
42
112
|
* @returns This builder for chaining.
|
|
43
113
|
* @example
|
|
44
114
|
* ```ts
|
|
45
|
-
*
|
|
46
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
47
|
-
* .setRisingStyle({ color: '#0DA471', hollow: true });
|
|
115
|
+
* builder.setRisingStyle({ color: '#0DA471', hollow: true });
|
|
48
116
|
* ```
|
|
49
117
|
*/
|
|
50
118
|
setRisingStyle(style: IChartCandlestickStateStyleSpec): this;
|
|
@@ -54,8 +122,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
54
122
|
* @returns This builder for chaining.
|
|
55
123
|
* @example
|
|
56
124
|
* ```ts
|
|
57
|
-
*
|
|
58
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick).clearRisingStyle();
|
|
125
|
+
* builder.clearRisingStyle();
|
|
59
126
|
* ```
|
|
60
127
|
*/
|
|
61
128
|
clearRisingStyle(): this;
|
|
@@ -66,9 +133,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
66
133
|
* @returns This builder for chaining.
|
|
67
134
|
* @example
|
|
68
135
|
* ```ts
|
|
69
|
-
*
|
|
70
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
71
|
-
* .setFallingStyle({ color: '#F05252' });
|
|
136
|
+
* builder.setFallingStyle({ color: '#F05252' });
|
|
72
137
|
* ```
|
|
73
138
|
*/
|
|
74
139
|
setFallingStyle(style: IChartCandlestickStateStyleSpec): this;
|
|
@@ -78,8 +143,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
78
143
|
* @returns This builder for chaining.
|
|
79
144
|
* @example
|
|
80
145
|
* ```ts
|
|
81
|
-
*
|
|
82
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick).clearFallingStyle();
|
|
146
|
+
* builder.clearFallingStyle();
|
|
83
147
|
* ```
|
|
84
148
|
*/
|
|
85
149
|
clearFallingStyle(): this;
|
|
@@ -90,9 +154,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
90
154
|
* @returns This builder for chaining.
|
|
91
155
|
* @example
|
|
92
156
|
* ```ts
|
|
93
|
-
*
|
|
94
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick)
|
|
95
|
-
* .setDojiStyle({ color: '#8C8C8C', border: { width: 2 } });
|
|
157
|
+
* builder.setDojiStyle({ color: '#8C8C8C', border: { width: 2 } });
|
|
96
158
|
* ```
|
|
97
159
|
*/
|
|
98
160
|
setDojiStyle(style: IChartCandlestickStateStyleSpec): this;
|
|
@@ -102,8 +164,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
102
164
|
* @returns This builder for chaining.
|
|
103
165
|
* @example
|
|
104
166
|
* ```ts
|
|
105
|
-
*
|
|
106
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick).clearDojiStyle();
|
|
167
|
+
* builder.clearDojiStyle();
|
|
107
168
|
* ```
|
|
108
169
|
*/
|
|
109
170
|
clearDojiStyle(): this;
|
|
@@ -114,8 +175,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
114
175
|
* @returns This builder for chaining.
|
|
115
176
|
* @example
|
|
116
177
|
* ```ts
|
|
117
|
-
*
|
|
118
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick).setCandleWidth(18);
|
|
178
|
+
* builder.setCandleWidth(18);
|
|
119
179
|
* ```
|
|
120
180
|
*/
|
|
121
181
|
setCandleWidth(width: number): this;
|
|
@@ -125,8 +185,7 @@ export declare class FCandlestickChartBuilder extends FAxisChartBuilder {
|
|
|
125
185
|
* @returns This builder for chaining.
|
|
126
186
|
* @example
|
|
127
187
|
* ```ts
|
|
128
|
-
*
|
|
129
|
-
* worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Candlestick).resetCandleWidth();
|
|
188
|
+
* builder.resetCandleWidth();
|
|
130
189
|
* ```
|
|
131
190
|
*/
|
|
132
191
|
resetCandleWidth(): this;
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { IChartChordEmphasisSpec, IChartChordLabelSpec, IChartChordLayoutSpec, IChartChordMappingSpec, IChartChordNodeStyleSpec, IChartChordRibbonStyleSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { IChartChordEmphasisSpec, IChartChordLabelSpec, IChartChordLayoutSpec, IChartChordMappingSpec, IChartChordNodeStyleSpec, IChartChordRibbonStyleSpec, IChartInfo } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
3
3
|
/**
|
|
4
4
|
* Fluent semantic builder for an undirected Source/Target/optional-Value edge list.
|
|
@@ -8,23 +8,195 @@ import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
|
8
8
|
* non-positive/non-finite mapped weights are skipped without coercion. Aggregate
|
|
9
9
|
* values are formatted after summing. Defaults are renderer-owned and require the
|
|
10
10
|
* native ECharts 6.1 Chord series; no renderer nodes, links, or layout are persisted.
|
|
11
|
+
*
|
|
12
|
+
* @example Sheet
|
|
13
|
+
* ```ts
|
|
14
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
15
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
16
|
+
* const chartInfo = fWorksheet
|
|
17
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Chord)
|
|
18
|
+
* .setSource('A1:C8')
|
|
19
|
+
* .setChordMapping({ sourceIndex: 0, targetIndex: 1, valueIndex: 2 })
|
|
20
|
+
* .setChordLayout({ startAngle: 90, clockwise: true, innerRadiusRatio: 0.4, outerRadiusRatio: 0.8 })
|
|
21
|
+
* .setChordNode({ color: '#2563eb', opacity: 0.8 })
|
|
22
|
+
* .setChordLabel({ visible: true, position: univerAPI.Enum.ChartChordLabelPosition.Outside, color: '#334155' })
|
|
23
|
+
* .setChordRibbon({ color: univerAPI.Enum.ChartChordRibbonColorMode.Gradient, opacity: 0.6 })
|
|
24
|
+
* .setChordEmphasis({ focus: univerAPI.Enum.ChartChordFocusMode.Adjacency })
|
|
25
|
+
* .build();
|
|
26
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
27
|
+
* ```
|
|
28
|
+
*
|
|
29
|
+
* @example Doc
|
|
30
|
+
* ```ts
|
|
31
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
32
|
+
* const chartInfo = fDocument
|
|
33
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Chord)
|
|
34
|
+
* .setSource([['Source', 'Target', 'Value'], ['A', 'B', 5], ['A', 'C', 3], ['B', 'C', 2]])
|
|
35
|
+
* .setChordMapping({ sourceIndex: 0, targetIndex: 1, valueIndex: 2 })
|
|
36
|
+
* .setChordLayout({ startAngle: 90, clockwise: true, innerRadiusRatio: 0.4, outerRadiusRatio: 0.8 })
|
|
37
|
+
* .setChordNode({ color: '#2563eb', opacity: 0.8 })
|
|
38
|
+
* .setChordLabel({ visible: true, position: univerAPI.Enum.ChartChordLabelPosition.Outside, color: '#334155' })
|
|
39
|
+
* .setChordRibbon({ color: univerAPI.Enum.ChartChordRibbonColorMode.Gradient, opacity: 0.6 })
|
|
40
|
+
* .setChordEmphasis({ focus: univerAPI.Enum.ChartChordFocusMode.Adjacency })
|
|
41
|
+
* .build();
|
|
42
|
+
* await fDocument.insertChart(chartInfo);
|
|
43
|
+
* ```
|
|
44
|
+
*
|
|
45
|
+
* @example Slide
|
|
46
|
+
* ```ts
|
|
47
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
48
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
49
|
+
* const chartInfo = fSlide
|
|
50
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Chord)
|
|
51
|
+
* .setSource([['Source', 'Target', 'Value'], ['A', 'B', 5], ['A', 'C', 3], ['B', 'C', 2]])
|
|
52
|
+
* .setChordMapping({ sourceIndex: 0, targetIndex: 1, valueIndex: 2 })
|
|
53
|
+
* .setChordLayout({ startAngle: 90, clockwise: true, innerRadiusRatio: 0.4, outerRadiusRatio: 0.8 })
|
|
54
|
+
* .setChordNode({ color: '#2563eb', opacity: 0.8 })
|
|
55
|
+
* .setChordLabel({ visible: true, position: univerAPI.Enum.ChartChordLabelPosition.Outside, color: '#334155' })
|
|
56
|
+
* .setChordRibbon({ color: univerAPI.Enum.ChartChordRibbonColorMode.Gradient, opacity: 0.6 })
|
|
57
|
+
* .setChordEmphasis({ focus: univerAPI.Enum.ChartChordFocusMode.Adjacency })
|
|
58
|
+
* .build();
|
|
59
|
+
* await fSlide.insertChart(chartInfo);
|
|
60
|
+
* ```
|
|
61
|
+
*
|
|
62
|
+
* @example Board
|
|
63
|
+
* ```ts
|
|
64
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
65
|
+
* const chartInfo = fBoard
|
|
66
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Chord)
|
|
67
|
+
* .setSource([['Source', 'Target', 'Value'], ['A', 'B', 5], ['A', 'C', 3], ['B', 'C', 2]])
|
|
68
|
+
* .setChordMapping({ sourceIndex: 0, targetIndex: 1, valueIndex: 2 })
|
|
69
|
+
* .setChordLayout({ startAngle: 90, clockwise: true, innerRadiusRatio: 0.4, outerRadiusRatio: 0.8 })
|
|
70
|
+
* .setChordNode({ color: '#2563eb', opacity: 0.8 })
|
|
71
|
+
* .setChordLabel({ visible: true, position: univerAPI.Enum.ChartChordLabelPosition.Outside, color: '#334155' })
|
|
72
|
+
* .setChordRibbon({ color: univerAPI.Enum.ChartChordRibbonColorMode.Gradient, opacity: 0.6 })
|
|
73
|
+
* .setChordEmphasis({ focus: univerAPI.Enum.ChartChordFocusMode.Adjacency })
|
|
74
|
+
* .build();
|
|
75
|
+
* await fBoard.insertChart(chartInfo);
|
|
76
|
+
* ```
|
|
11
77
|
*/
|
|
12
|
-
export declare class FChordChartBuilder extends FChartBuilderBase {
|
|
78
|
+
export declare class FChordChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FChartBuilderBase<TSource, TDataSource, TInfo> {
|
|
79
|
+
/**
|
|
80
|
+
* Sets the Source, Target, and optional Value field indexes for Chord edges.
|
|
81
|
+
*
|
|
82
|
+
* @param value Zero-based field indexes for each edge component.
|
|
83
|
+
* @returns This builder for chaining.
|
|
84
|
+
* @example
|
|
85
|
+
* ```ts
|
|
86
|
+
* builder.setChordMapping({ sourceIndex: 0, targetIndex: 1, valueIndex: 2 });
|
|
87
|
+
* ```
|
|
88
|
+
*/
|
|
13
89
|
setChordMapping(value: IChartChordMappingSpec): this;
|
|
14
|
-
|
|
90
|
+
/**
|
|
91
|
+
* Sets the Chord radius, rotation, and spacing layout.
|
|
92
|
+
*
|
|
93
|
+
* @param value Chord layout settings.
|
|
94
|
+
* @returns This builder for chaining.
|
|
95
|
+
* @example
|
|
96
|
+
* ```ts
|
|
97
|
+
* builder.setChordLayout({ startAngle: 90, clockwise: true });
|
|
98
|
+
* ```
|
|
99
|
+
*/
|
|
15
100
|
setChordLayout(value: IChartChordLayoutSpec): this;
|
|
101
|
+
/**
|
|
102
|
+
* Resets the Chord layout to renderer defaults.
|
|
103
|
+
*
|
|
104
|
+
* @returns This builder for chaining.
|
|
105
|
+
* @example
|
|
106
|
+
* ```ts
|
|
107
|
+
* builder.resetChordLayout();
|
|
108
|
+
* ```
|
|
109
|
+
*/
|
|
16
110
|
resetChordLayout(): this;
|
|
17
|
-
|
|
111
|
+
/**
|
|
112
|
+
* Sets Chart-wide Chord node styling.
|
|
113
|
+
*
|
|
114
|
+
* @param value Chord node appearance settings.
|
|
115
|
+
* @returns This builder for chaining.
|
|
116
|
+
* @example
|
|
117
|
+
* ```ts
|
|
118
|
+
* builder.setChordNode({ color: '#2563eb', opacity: 0.8 });
|
|
119
|
+
* ```
|
|
120
|
+
*/
|
|
18
121
|
setChordNode(value: IChartChordNodeStyleSpec): this;
|
|
122
|
+
/**
|
|
123
|
+
* Resets Chord node styling to renderer defaults.
|
|
124
|
+
*
|
|
125
|
+
* @returns This builder for chaining.
|
|
126
|
+
* @example
|
|
127
|
+
* ```ts
|
|
128
|
+
* builder.resetChordNode();
|
|
129
|
+
* ```
|
|
130
|
+
*/
|
|
19
131
|
resetChordNode(): this;
|
|
20
|
-
|
|
132
|
+
/**
|
|
133
|
+
* Sets Chord node-label visibility, position, and styling.
|
|
134
|
+
*
|
|
135
|
+
* @param value Chord label settings.
|
|
136
|
+
* @returns This builder for chaining.
|
|
137
|
+
* @example
|
|
138
|
+
* ```ts
|
|
139
|
+
* builder.setChordLabel({
|
|
140
|
+
* visible: true,
|
|
141
|
+
* position: univerAPI.Enum.ChartChordLabelPosition.Outside,
|
|
142
|
+
* color: '#334155',
|
|
143
|
+
* });
|
|
144
|
+
* ```
|
|
145
|
+
*/
|
|
21
146
|
setChordLabel(value: IChartChordLabelSpec): this;
|
|
147
|
+
/**
|
|
148
|
+
* Resets Chord labels to renderer defaults.
|
|
149
|
+
*
|
|
150
|
+
* @returns This builder for chaining.
|
|
151
|
+
* @example
|
|
152
|
+
* ```ts
|
|
153
|
+
* builder.resetChordLabel();
|
|
154
|
+
* ```
|
|
155
|
+
*/
|
|
22
156
|
resetChordLabel(): this;
|
|
23
|
-
|
|
157
|
+
/**
|
|
158
|
+
* Sets Chord ribbon color, opacity, and border styling.
|
|
159
|
+
*
|
|
160
|
+
* @param value Chord ribbon appearance settings.
|
|
161
|
+
* @returns This builder for chaining.
|
|
162
|
+
* @example
|
|
163
|
+
* ```ts
|
|
164
|
+
* builder.setChordRibbon({
|
|
165
|
+
* color: univerAPI.Enum.ChartChordRibbonColorMode.Gradient,
|
|
166
|
+
* opacity: 0.6,
|
|
167
|
+
* });
|
|
168
|
+
* ```
|
|
169
|
+
*/
|
|
24
170
|
setChordRibbon(value: IChartChordRibbonStyleSpec): this;
|
|
171
|
+
/**
|
|
172
|
+
* Resets Chord ribbon styling to renderer defaults.
|
|
173
|
+
*
|
|
174
|
+
* @returns This builder for chaining.
|
|
175
|
+
* @example
|
|
176
|
+
* ```ts
|
|
177
|
+
* builder.resetChordRibbon();
|
|
178
|
+
* ```
|
|
179
|
+
*/
|
|
25
180
|
resetChordRibbon(): this;
|
|
26
|
-
|
|
181
|
+
/**
|
|
182
|
+
* Sets hover emphasis and focus behavior.
|
|
183
|
+
*
|
|
184
|
+
* @param value Chord emphasis settings.
|
|
185
|
+
* @returns This builder for chaining.
|
|
186
|
+
* @example
|
|
187
|
+
* ```ts
|
|
188
|
+
* builder.setChordEmphasis({ focus: univerAPI.Enum.ChartChordFocusMode.Adjacency });
|
|
189
|
+
* ```
|
|
190
|
+
*/
|
|
27
191
|
setChordEmphasis(value: IChartChordEmphasisSpec): this;
|
|
192
|
+
/**
|
|
193
|
+
* Resets Chord emphasis behavior to renderer defaults.
|
|
194
|
+
*
|
|
195
|
+
* @returns This builder for chaining.
|
|
196
|
+
* @example
|
|
197
|
+
* ```ts
|
|
198
|
+
* builder.resetChordEmphasis();
|
|
199
|
+
* ```
|
|
200
|
+
*/
|
|
28
201
|
resetChordEmphasis(): this;
|
|
29
|
-
getChordEmphasis(): IChartChordEmphasisSpec | undefined;
|
|
30
202
|
}
|
|
@@ -1,6 +1,59 @@
|
|
|
1
|
-
import type { ChartPublicSeriesSelector, ChartSeriesAxis, ChartSeriesTypeString } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { ChartPublicSeriesSelector, ChartSeriesAxis, ChartSeriesTypeString, IChartInfo, IChartSeriesPatch, IChartSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fluent, type-specific Builder for mixed Column, Line, and Area Combination Charts.
|
|
5
|
+
*
|
|
6
|
+
* @example Sheet
|
|
7
|
+
* ```ts
|
|
8
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
9
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
10
|
+
* const chartInfo = fWorksheet
|
|
11
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Combination)
|
|
12
|
+
* .setSource('A1:D8')
|
|
13
|
+
* .setSeriesType(0, univerAPI.Enum.ChartSeriesTypeString.Line)
|
|
14
|
+
* .setSeriesAxis(0, univerAPI.Enum.ChartSeriesAxis.Right)
|
|
15
|
+
* .build();
|
|
16
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
17
|
+
* ```
|
|
18
|
+
*
|
|
19
|
+
* @example Doc
|
|
20
|
+
* ```ts
|
|
21
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
22
|
+
* const chartInfo = fDocument
|
|
23
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Combination)
|
|
24
|
+
* .setSource([['Month', 'Sales', 'Profit'], ['Jan', 120, 24], ['Feb', 180, 38]])
|
|
25
|
+
* .setSeriesType(0, univerAPI.Enum.ChartSeriesTypeString.Line)
|
|
26
|
+
* .setSeriesAxis(0, univerAPI.Enum.ChartSeriesAxis.Right)
|
|
27
|
+
* .build();
|
|
28
|
+
* await fDocument.insertChart(chartInfo);
|
|
29
|
+
* ```
|
|
30
|
+
*
|
|
31
|
+
* @example Slide
|
|
32
|
+
* ```ts
|
|
33
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
34
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
35
|
+
* const chartInfo = fSlide
|
|
36
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Combination)
|
|
37
|
+
* .setSource([['Month', 'Sales', 'Profit'], ['Jan', 120, 24], ['Feb', 180, 38]])
|
|
38
|
+
* .setSeriesType(0, univerAPI.Enum.ChartSeriesTypeString.Line)
|
|
39
|
+
* .setSeriesAxis(0, univerAPI.Enum.ChartSeriesAxis.Right)
|
|
40
|
+
* .build();
|
|
41
|
+
* await fSlide.insertChart(chartInfo);
|
|
42
|
+
* ```
|
|
43
|
+
*
|
|
44
|
+
* @example Board
|
|
45
|
+
* ```ts
|
|
46
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
47
|
+
* const chartInfo = fBoard
|
|
48
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Combination)
|
|
49
|
+
* .setSource([['Month', 'Sales', 'Profit'], ['Jan', 120, 24], ['Feb', 180, 38]])
|
|
50
|
+
* .setSeriesType(0, univerAPI.Enum.ChartSeriesTypeString.Line)
|
|
51
|
+
* .setSeriesAxis(0, univerAPI.Enum.ChartSeriesAxis.Right)
|
|
52
|
+
* .build();
|
|
53
|
+
* await fBoard.insertChart(chartInfo);
|
|
54
|
+
* ```
|
|
55
|
+
*/
|
|
56
|
+
export declare class FCombinationChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FCartesianChartBuilder<Omit<IChartSeriesPatch, 'selector'>, IChartSeriesStyleSpec, TSource, TDataSource, TInfo> {
|
|
4
57
|
/**
|
|
5
58
|
* Sets the series type configuration and returns this builder for chaining.
|
|
6
59
|
*
|
|
@@ -11,8 +64,6 @@ export declare class FCombinationChartBuilder extends FCartesianChartBuilder {
|
|
|
11
64
|
* @returns This builder for chaining.
|
|
12
65
|
* @example
|
|
13
66
|
* ```ts
|
|
14
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
15
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Combination);
|
|
16
67
|
* builder.setSeriesType(0, univerAPI.Enum.ChartSeriesTypeString.Line);
|
|
17
68
|
* ```
|
|
18
69
|
*/
|
|
@@ -26,8 +77,6 @@ export declare class FCombinationChartBuilder extends FCartesianChartBuilder {
|
|
|
26
77
|
* @returns This builder for chaining.
|
|
27
78
|
* @example
|
|
28
79
|
* ```ts
|
|
29
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
30
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Combination);
|
|
31
80
|
* builder.resetSeriesType(0);
|
|
32
81
|
* ```
|
|
33
82
|
*/
|
|
@@ -42,8 +91,6 @@ export declare class FCombinationChartBuilder extends FCartesianChartBuilder {
|
|
|
42
91
|
* @returns This builder for chaining.
|
|
43
92
|
* @example
|
|
44
93
|
* ```ts
|
|
45
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
46
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Combination);
|
|
47
94
|
* builder.setSeriesAxis(0, univerAPI.Enum.ChartSeriesAxis.Right);
|
|
48
95
|
* ```
|
|
49
96
|
*/
|
|
@@ -57,8 +104,6 @@ export declare class FCombinationChartBuilder extends FCartesianChartBuilder {
|
|
|
57
104
|
* @returns This builder for chaining.
|
|
58
105
|
* @example
|
|
59
106
|
* ```ts
|
|
60
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
61
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Combination);
|
|
62
107
|
* builder.resetSeriesAxis(0);
|
|
63
108
|
* ```
|
|
64
109
|
*/
|