@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,6 +1,62 @@
|
|
|
1
|
-
import type { IChartScatterMappingSpec, IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { IChartInfo, IChartScatterMappingSpec, IChartSolidSeriesPatch, IChartSolidSeriesStyleSpec } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
|
|
3
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fluent, type-specific Builder for Scatter Charts.
|
|
5
|
+
*
|
|
6
|
+
* The data source is an observation table: each row represents one point. Map two
|
|
7
|
+
* numeric fields to X and Y; an optional label field supplies point labels. All mapped
|
|
8
|
+
* fields are aligned by row, so their source vectors must have the same length.
|
|
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.Scatter)
|
|
16
|
+
* .setSource({
|
|
17
|
+
* range: 'A1:C8',
|
|
18
|
+
* orientation: univerAPI.Enum.ChartSourceOrientation.Columns,
|
|
19
|
+
* })
|
|
20
|
+
* .setScatterMapping({ xIndex: 0, yIndex: 1, labelIndex: 2 })
|
|
21
|
+
* .build();
|
|
22
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
23
|
+
* ```
|
|
24
|
+
*
|
|
25
|
+
* @example Doc
|
|
26
|
+
* ```ts
|
|
27
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
28
|
+
* const chartInfo = fDocument
|
|
29
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Scatter)
|
|
30
|
+
* .setSource([['X', 'Y'], [10, 20], [18, 32], [24, 28]])
|
|
31
|
+
* .setScatterMapping({ xIndex: 0, yIndex: 1 })
|
|
32
|
+
* .build();
|
|
33
|
+
* await fDocument.insertChart(chartInfo);
|
|
34
|
+
* ```
|
|
35
|
+
*
|
|
36
|
+
* @example Slide
|
|
37
|
+
* ```ts
|
|
38
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
39
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
40
|
+
* const chartInfo = fSlide
|
|
41
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Scatter)
|
|
42
|
+
* .setSource([['X', 'Y'], [10, 20], [18, 32], [24, 28]])
|
|
43
|
+
* .setScatterMapping({ xIndex: 0, yIndex: 1 })
|
|
44
|
+
* .build();
|
|
45
|
+
* await fSlide.insertChart(chartInfo);
|
|
46
|
+
* ```
|
|
47
|
+
*
|
|
48
|
+
* @example Board
|
|
49
|
+
* ```ts
|
|
50
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
51
|
+
* const chartInfo = fBoard
|
|
52
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Scatter)
|
|
53
|
+
* .setSource([['X', 'Y'], [10, 20], [18, 32], [24, 28]])
|
|
54
|
+
* .setScatterMapping({ xIndex: 0, yIndex: 1 })
|
|
55
|
+
* .build();
|
|
56
|
+
* await fBoard.insertChart(chartInfo);
|
|
57
|
+
* ```
|
|
58
|
+
*/
|
|
59
|
+
export declare class FScatterChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FCartesianChartBuilder<Omit<IChartSolidSeriesPatch, 'selector'>, IChartSolidSeriesStyleSpec, TSource, TDataSource, TInfo> {
|
|
4
60
|
/**
|
|
5
61
|
* Sets the scatter mapping configuration and returns this builder for chaining.
|
|
6
62
|
*
|
|
@@ -10,8 +66,6 @@ export declare class FScatterChartBuilder extends FCartesianChartBuilder<Omit<IC
|
|
|
10
66
|
* @returns This builder for chaining.
|
|
11
67
|
* @example
|
|
12
68
|
* ```ts
|
|
13
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
14
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Scatter);
|
|
15
69
|
* builder.setScatterMapping({ xIndex: 0, yIndex: 1 });
|
|
16
70
|
* ```
|
|
17
71
|
*/
|
|
@@ -24,8 +78,6 @@ export declare class FScatterChartBuilder extends FCartesianChartBuilder<Omit<IC
|
|
|
24
78
|
* @returns This builder for chaining.
|
|
25
79
|
* @example
|
|
26
80
|
* ```ts
|
|
27
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
28
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Scatter);
|
|
29
81
|
* builder.clearScatterMapping();
|
|
30
82
|
* ```
|
|
31
83
|
*/
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeepNullish, IChartSunburstCenterLabelSpec, IChartSunburstLabelSpec } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { DeepNullish, IChartInfo, IChartSunburstCenterLabelSpec, IChartSunburstLabelSpec } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
3
3
|
/**
|
|
4
4
|
* Fluent semantic builder for an automatically laid-out Sunburst chart.
|
|
@@ -7,18 +7,132 @@ import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
|
7
7
|
* least one ordered hierarchy field and exactly one value field. Duplicate complete paths
|
|
8
8
|
* sum finite numeric values; sparse hierarchy values inherit within ancestor scope; parent
|
|
9
9
|
* facts add to child totals. Ring layout is automatic and root navigation is disabled.
|
|
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.Sunburst)
|
|
17
|
+
* .setSource('A1:D8')
|
|
18
|
+
* .setHierarchyFields([0, 1, 2])
|
|
19
|
+
* .setValueField(3)
|
|
20
|
+
* .setSunburstLabel({ visible: true, position: univerAPI.Enum.ChartSunburstLabelPosition.Outside, color: '#334155' })
|
|
21
|
+
* .setCenterLabel({ visible: true, color: '#0f172a' })
|
|
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.Sunburst)
|
|
31
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
32
|
+
* .setHierarchyFields([0, 1, 2])
|
|
33
|
+
* .setValueField(3)
|
|
34
|
+
* .setSunburstLabel({ visible: true, position: univerAPI.Enum.ChartSunburstLabelPosition.Outside, color: '#334155' })
|
|
35
|
+
* .setCenterLabel({ visible: true, color: '#0f172a' })
|
|
36
|
+
* .build();
|
|
37
|
+
* await fDocument.insertChart(chartInfo);
|
|
38
|
+
* ```
|
|
39
|
+
*
|
|
40
|
+
* @example Slide
|
|
41
|
+
* ```ts
|
|
42
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
43
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
44
|
+
* const chartInfo = fSlide
|
|
45
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Sunburst)
|
|
46
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
47
|
+
* .setHierarchyFields([0, 1, 2])
|
|
48
|
+
* .setValueField(3)
|
|
49
|
+
* .setSunburstLabel({ visible: true, position: univerAPI.Enum.ChartSunburstLabelPosition.Outside, color: '#334155' })
|
|
50
|
+
* .setCenterLabel({ visible: true, color: '#0f172a' })
|
|
51
|
+
* .build();
|
|
52
|
+
* await fSlide.insertChart(chartInfo);
|
|
53
|
+
* ```
|
|
54
|
+
*
|
|
55
|
+
* @example Board
|
|
56
|
+
* ```ts
|
|
57
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
58
|
+
* const chartInfo = fBoard
|
|
59
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Sunburst)
|
|
60
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
61
|
+
* .setHierarchyFields([0, 1, 2])
|
|
62
|
+
* .setValueField(3)
|
|
63
|
+
* .setSunburstLabel({ visible: true, position: univerAPI.Enum.ChartSunburstLabelPosition.Outside, color: '#334155' })
|
|
64
|
+
* .setCenterLabel({ visible: true, color: '#0f172a' })
|
|
65
|
+
* .build();
|
|
66
|
+
* await fBoard.insertChart(chartInfo);
|
|
67
|
+
* ```
|
|
10
68
|
*/
|
|
11
|
-
export declare class FSunburstChartBuilder extends FChartBuilderBase {
|
|
12
|
-
/**
|
|
69
|
+
export declare class FSunburstChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FChartBuilderBase<TSource, TDataSource, TInfo> {
|
|
70
|
+
/**
|
|
71
|
+
* Replaces the ordered inner-to-outer hierarchy with zero-based field indexes.
|
|
72
|
+
*
|
|
73
|
+
* @param indexes Ordered hierarchy field indexes.
|
|
74
|
+
* @returns This builder for chaining.
|
|
75
|
+
* @example
|
|
76
|
+
* ```ts
|
|
77
|
+
* builder.setHierarchyFields([0, 1, 2]);
|
|
78
|
+
* ```
|
|
79
|
+
*/
|
|
13
80
|
setHierarchyFields(indexes: readonly number[]): this;
|
|
14
|
-
/**
|
|
81
|
+
/**
|
|
82
|
+
* Replaces the sole numeric value field with a zero-based field index.
|
|
83
|
+
*
|
|
84
|
+
* @param index Numeric value field index.
|
|
85
|
+
* @returns This builder for chaining.
|
|
86
|
+
* @example
|
|
87
|
+
* ```ts
|
|
88
|
+
* builder.setValueField(3);
|
|
89
|
+
* ```
|
|
90
|
+
*/
|
|
15
91
|
setValueField(index: number): this;
|
|
16
|
-
/**
|
|
92
|
+
/**
|
|
93
|
+
* Sets label visibility, content, position, and font appearance.
|
|
94
|
+
*
|
|
95
|
+
* @param label Sunburst label settings.
|
|
96
|
+
* @returns This builder for chaining.
|
|
97
|
+
* @example
|
|
98
|
+
* ```ts
|
|
99
|
+
* builder.setSunburstLabel({
|
|
100
|
+
* visible: true,
|
|
101
|
+
* position: univerAPI.Enum.ChartSunburstLabelPosition.Outside,
|
|
102
|
+
* color: '#334155',
|
|
103
|
+
* });
|
|
104
|
+
* ```
|
|
105
|
+
*/
|
|
17
106
|
setSunburstLabel(label: DeepNullish<IChartSunburstLabelSpec>): this;
|
|
18
|
-
/**
|
|
107
|
+
/**
|
|
108
|
+
* Removes explicit label style and restores visible category-name labels.
|
|
109
|
+
*
|
|
110
|
+
* @returns This builder for chaining.
|
|
111
|
+
* @example
|
|
112
|
+
* ```ts
|
|
113
|
+
* builder.resetSunburstLabel();
|
|
114
|
+
* ```
|
|
115
|
+
*/
|
|
19
116
|
resetSunburstLabel(): this;
|
|
20
|
-
/**
|
|
117
|
+
/**
|
|
118
|
+
* Sets visibility, number format, and font appearance for the aggregate center value.
|
|
119
|
+
*
|
|
120
|
+
* @param centerLabel Center-label settings.
|
|
121
|
+
* @returns This builder for chaining.
|
|
122
|
+
* @example
|
|
123
|
+
* ```ts
|
|
124
|
+
* builder.setCenterLabel({ visible: true, color: '#0f172a' });
|
|
125
|
+
* ```
|
|
126
|
+
*/
|
|
21
127
|
setCenterLabel(centerLabel: DeepNullish<IChartSunburstCenterLabelSpec>): this;
|
|
22
|
-
/**
|
|
128
|
+
/**
|
|
129
|
+
* Removes the authored center-label style and restores its hidden default.
|
|
130
|
+
*
|
|
131
|
+
* @returns This builder for chaining.
|
|
132
|
+
* @example
|
|
133
|
+
* ```ts
|
|
134
|
+
* builder.resetCenterLabel();
|
|
135
|
+
* ```
|
|
136
|
+
*/
|
|
23
137
|
resetCenterLabel(): this;
|
|
24
138
|
}
|
|
@@ -1,4 +1,4 @@
|
|
|
1
|
-
import type { DeepNullish, IChartTreemapLabelSpec, TreemapParentLabelLayout } from '@univerjs-pro/engine-chart';
|
|
1
|
+
import type { DeepNullish, IChartInfo, IChartTreemapLabelSpec, TreemapParentLabelLayout } from '@univerjs-pro/engine-chart';
|
|
2
2
|
import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
3
3
|
/**
|
|
4
4
|
* Fluent semantic builder for an automatically laid-out Treemap.
|
|
@@ -10,25 +10,127 @@ import { FChartBuilderBase } from '../f-chart-builder-base';
|
|
|
10
10
|
* is disabled. The runtime defaults are banner parent labels and visible category-name
|
|
11
11
|
* leaf labels; labels may hide when their rectangle cannot fit the complete content.
|
|
12
12
|
*
|
|
13
|
-
* @example
|
|
14
|
-
*
|
|
15
|
-
*
|
|
13
|
+
* @example Sheet
|
|
14
|
+
* ```ts
|
|
15
|
+
* const fWorkbook = univerAPI.getActiveWorkbook();
|
|
16
|
+
* const fWorksheet = fWorkbook.getSheetByName('Sheet1');
|
|
17
|
+
* const chartInfo = fWorksheet
|
|
18
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Treemap)
|
|
19
|
+
* .setSource('A1:D8')
|
|
16
20
|
* .setHierarchyFields([0, 1, 2])
|
|
17
21
|
* .setValueField(3)
|
|
18
|
-
* .setParentLabelLayout(
|
|
19
|
-
* .setTreemapLabel({ visible: true,
|
|
22
|
+
* .setParentLabelLayout(univerAPI.Enum.ChartTreemapParentLabelLayout.Banner)
|
|
23
|
+
* .setTreemapLabel({ visible: true, color: '#334155' })
|
|
24
|
+
* .build();
|
|
25
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
26
|
+
* ```
|
|
27
|
+
*
|
|
28
|
+
* @example Doc
|
|
29
|
+
* ```ts
|
|
30
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
31
|
+
* const chartInfo = fDocument
|
|
32
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Treemap)
|
|
33
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
34
|
+
* .setHierarchyFields([0, 1, 2])
|
|
35
|
+
* .setValueField(3)
|
|
36
|
+
* .setParentLabelLayout(univerAPI.Enum.ChartTreemapParentLabelLayout.Banner)
|
|
37
|
+
* .setTreemapLabel({ visible: true, color: '#334155' })
|
|
38
|
+
* .build();
|
|
39
|
+
* await fDocument.insertChart(chartInfo);
|
|
40
|
+
* ```
|
|
41
|
+
*
|
|
42
|
+
* @example Slide
|
|
43
|
+
* ```ts
|
|
44
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
45
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
46
|
+
* const chartInfo = fSlide
|
|
47
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Treemap)
|
|
48
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
49
|
+
* .setHierarchyFields([0, 1, 2])
|
|
50
|
+
* .setValueField(3)
|
|
51
|
+
* .setParentLabelLayout(univerAPI.Enum.ChartTreemapParentLabelLayout.Banner)
|
|
52
|
+
* .setTreemapLabel({ visible: true, color: '#334155' })
|
|
53
|
+
* .build();
|
|
54
|
+
* await fSlide.insertChart(chartInfo);
|
|
55
|
+
* ```
|
|
56
|
+
*
|
|
57
|
+
* @example Board
|
|
58
|
+
* ```ts
|
|
59
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
60
|
+
* const chartInfo = fBoard
|
|
61
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Treemap)
|
|
62
|
+
* .setSource([['Region', 'Country', 'City', 'Sales'], ['Europe', 'France', 'Paris', 120], ['Asia', 'Japan', 'Tokyo', 180]])
|
|
63
|
+
* .setHierarchyFields([0, 1, 2])
|
|
64
|
+
* .setValueField(3)
|
|
65
|
+
* .setParentLabelLayout(univerAPI.Enum.ChartTreemapParentLabelLayout.Banner)
|
|
66
|
+
* .setTreemapLabel({ visible: true, color: '#334155' })
|
|
67
|
+
* .build();
|
|
68
|
+
* await fBoard.insertChart(chartInfo);
|
|
69
|
+
* ```
|
|
20
70
|
*/
|
|
21
|
-
export declare class FTreemapChartBuilder extends FChartBuilderBase {
|
|
22
|
-
/**
|
|
71
|
+
export declare class FTreemapChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FChartBuilderBase<TSource, TDataSource, TInfo> {
|
|
72
|
+
/**
|
|
73
|
+
* Replaces the ordered root-to-leaf hierarchy with zero-based field indexes.
|
|
74
|
+
*
|
|
75
|
+
* @param indexes Ordered hierarchy field indexes.
|
|
76
|
+
* @returns This builder for chaining.
|
|
77
|
+
* @example
|
|
78
|
+
* ```ts
|
|
79
|
+
* builder.setHierarchyFields([0, 1, 2]);
|
|
80
|
+
* ```
|
|
81
|
+
*/
|
|
23
82
|
setHierarchyFields(indexes: readonly number[]): this;
|
|
24
|
-
/**
|
|
83
|
+
/**
|
|
84
|
+
* Replaces the sole numeric value field with a zero-based field index.
|
|
85
|
+
*
|
|
86
|
+
* @param index Numeric value field index.
|
|
87
|
+
* @returns This builder for chaining.
|
|
88
|
+
* @example
|
|
89
|
+
* ```ts
|
|
90
|
+
* builder.setValueField(3);
|
|
91
|
+
* ```
|
|
92
|
+
*/
|
|
25
93
|
setValueField(index: number): this;
|
|
26
|
-
/**
|
|
94
|
+
/**
|
|
95
|
+
* Sets parent names to a reserved banner, overlapping text, or hidden.
|
|
96
|
+
*
|
|
97
|
+
* @param layout Parent-label layout mode.
|
|
98
|
+
* @returns This builder for chaining.
|
|
99
|
+
* @example
|
|
100
|
+
* ```ts
|
|
101
|
+
* builder.setParentLabelLayout(univerAPI.Enum.ChartTreemapParentLabelLayout.Banner);
|
|
102
|
+
* ```
|
|
103
|
+
*/
|
|
27
104
|
setParentLabelLayout(layout: TreemapParentLabelLayout): this;
|
|
28
|
-
/**
|
|
105
|
+
/**
|
|
106
|
+
* Removes the explicit parent layout and restores the runtime banner default.
|
|
107
|
+
*
|
|
108
|
+
* @returns This builder for chaining.
|
|
109
|
+
* @example
|
|
110
|
+
* ```ts
|
|
111
|
+
* builder.resetParentLabelLayout();
|
|
112
|
+
* ```
|
|
113
|
+
*/
|
|
29
114
|
resetParentLabelLayout(): this;
|
|
30
|
-
/**
|
|
115
|
+
/**
|
|
116
|
+
* Sets leaf visibility, content, and font appearance.
|
|
117
|
+
*
|
|
118
|
+
* @param label Treemap leaf-label settings.
|
|
119
|
+
* @returns This builder for chaining.
|
|
120
|
+
* @example
|
|
121
|
+
* ```ts
|
|
122
|
+
* builder.setTreemapLabel({ visible: true, color: '#334155' });
|
|
123
|
+
* ```
|
|
124
|
+
*/
|
|
31
125
|
setTreemapLabel(label: DeepNullish<IChartTreemapLabelSpec>): this;
|
|
32
|
-
/**
|
|
126
|
+
/**
|
|
127
|
+
* Removes explicit leaf-label style and restores visible category-name labels.
|
|
128
|
+
*
|
|
129
|
+
* @returns This builder for chaining.
|
|
130
|
+
* @example
|
|
131
|
+
* ```ts
|
|
132
|
+
* builder.resetTreemapLabel();
|
|
133
|
+
* ```
|
|
134
|
+
*/
|
|
33
135
|
resetTreemapLabel(): this;
|
|
34
136
|
}
|
|
@@ -1,19 +1,79 @@
|
|
|
1
|
-
import type { ChartPublicSeriesSelector, IChartSeriesPatch, IChartWaterfallConnectorStyleSpec, IChartWaterfallPointRoleSpec, WaterfallStackTypeEnum } from '@univerjs-pro/engine-chart';
|
|
2
|
-
import type { DeepReadonly } from '@univerjs/core';
|
|
1
|
+
import type { ChartPublicSeriesSelector, IChartInfo, IChartSeriesPatch, IChartSeriesStyleSpec, IChartWaterfallConnectorStyleSpec, IChartWaterfallPointRoleSpec, WaterfallStackTypeEnum } from '@univerjs-pro/engine-chart';
|
|
3
2
|
import { FCartesianChartBuilder } from '../f-cartesian-chart-builder';
|
|
4
|
-
|
|
5
|
-
|
|
6
|
-
|
|
7
|
-
|
|
8
|
-
|
|
9
|
-
|
|
10
|
-
|
|
11
|
-
|
|
12
|
-
|
|
13
|
-
|
|
14
|
-
|
|
15
|
-
|
|
16
|
-
|
|
3
|
+
/**
|
|
4
|
+
* Fluent, type-specific Builder for Waterfall 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.Waterfall)
|
|
12
|
+
* .setSource('A1:B8')
|
|
13
|
+
* .setPointRoles([{ series: 0, dataPointIndex: 3, role: univerAPI.Enum.ChartWaterfallPointRole.Total }])
|
|
14
|
+
* .setConnector(true)
|
|
15
|
+
* .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)
|
|
16
|
+
* .setUseSubtotal(true)
|
|
17
|
+
* .setPositiveStyle(0, { color: '#16a34a' })
|
|
18
|
+
* .setNegativeStyle(0, { color: '#dc2626' })
|
|
19
|
+
* .setSubtotalStyle(0, { color: '#2563eb' })
|
|
20
|
+
* .build();
|
|
21
|
+
* await fWorksheet.insertChart(chartInfo);
|
|
22
|
+
* ```
|
|
23
|
+
*
|
|
24
|
+
* @example Doc
|
|
25
|
+
* ```ts
|
|
26
|
+
* const fDocument = univerAPI.getActiveDocument();
|
|
27
|
+
* const chartInfo = fDocument
|
|
28
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Waterfall)
|
|
29
|
+
* .setSource([['Stage', 'Change'], ['Revenue', 300], ['Costs', -180], ['Profit', 120]])
|
|
30
|
+
* .setPointRoles([{ series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total }])
|
|
31
|
+
* .setConnector(true)
|
|
32
|
+
* .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)
|
|
33
|
+
* .setUseSubtotal(true)
|
|
34
|
+
* .setPositiveStyle(0, { color: '#16a34a' })
|
|
35
|
+
* .setNegativeStyle(0, { color: '#dc2626' })
|
|
36
|
+
* .setSubtotalStyle(0, { color: '#2563eb' })
|
|
37
|
+
* .build();
|
|
38
|
+
* await fDocument.insertChart(chartInfo);
|
|
39
|
+
* ```
|
|
40
|
+
*
|
|
41
|
+
* @example Slide
|
|
42
|
+
* ```ts
|
|
43
|
+
* const fPresentation = univerAPI.getActivePresentation();
|
|
44
|
+
* const fSlide = fPresentation.getSlideByIndex(0);
|
|
45
|
+
* const chartInfo = fSlide
|
|
46
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Waterfall)
|
|
47
|
+
* .setSource([['Stage', 'Change'], ['Revenue', 300], ['Costs', -180], ['Profit', 120]])
|
|
48
|
+
* .setPointRoles([{ series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total }])
|
|
49
|
+
* .setConnector(true)
|
|
50
|
+
* .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)
|
|
51
|
+
* .setUseSubtotal(true)
|
|
52
|
+
* .setPositiveStyle(0, { color: '#16a34a' })
|
|
53
|
+
* .setNegativeStyle(0, { color: '#dc2626' })
|
|
54
|
+
* .setSubtotalStyle(0, { color: '#2563eb' })
|
|
55
|
+
* .build();
|
|
56
|
+
* await fSlide.insertChart(chartInfo);
|
|
57
|
+
* ```
|
|
58
|
+
*
|
|
59
|
+
* @example Board
|
|
60
|
+
* ```ts
|
|
61
|
+
* const fBoard = univerAPI.getActiveBoard();
|
|
62
|
+
* const chartInfo = fBoard
|
|
63
|
+
* .newChart(univerAPI.Enum.ChartTypeString.Waterfall)
|
|
64
|
+
* .setSource([['Stage', 'Change'], ['Revenue', 300], ['Costs', -180], ['Profit', 120]])
|
|
65
|
+
* .setPointRoles([{ series: 0, dataPointIndex: 2, role: univerAPI.Enum.ChartWaterfallPointRole.Total }])
|
|
66
|
+
* .setConnector(true)
|
|
67
|
+
* .setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement)
|
|
68
|
+
* .setUseSubtotal(true)
|
|
69
|
+
* .setPositiveStyle(0, { color: '#16a34a' })
|
|
70
|
+
* .setNegativeStyle(0, { color: '#dc2626' })
|
|
71
|
+
* .setSubtotalStyle(0, { color: '#2563eb' })
|
|
72
|
+
* .build();
|
|
73
|
+
* await fBoard.insertChart(chartInfo);
|
|
74
|
+
* ```
|
|
75
|
+
*/
|
|
76
|
+
export declare class FWaterfallChartBuilder<TSource = never[], TDataSource = TSource, TInfo extends IChartInfo<TDataSource> = IChartInfo<TDataSource>> extends FCartesianChartBuilder<Omit<IChartSeriesPatch, 'selector'>, IChartSeriesStyleSpec, TSource, TDataSource, TInfo> {
|
|
17
77
|
/**
|
|
18
78
|
* Replaces all Waterfall point roles.
|
|
19
79
|
*
|
|
@@ -23,10 +83,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
23
83
|
* @returns This builder for chaining.
|
|
24
84
|
* @example
|
|
25
85
|
* ```ts
|
|
26
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
27
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
28
86
|
* builder.setPointRoles([{ series: 0, dataPointIndex: 0, role: univerAPI.Enum.ChartWaterfallPointRole.Total }]);
|
|
29
|
-
* const roles = builder.
|
|
87
|
+
* const roles = builder.build().config.waterfall?.pointRoles;
|
|
30
88
|
* ```
|
|
31
89
|
*/
|
|
32
90
|
setPointRoles(roles: readonly IChartWaterfallPointRoleSpec[]): this;
|
|
@@ -37,16 +95,14 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
37
95
|
* and a neutral `#8C8C8C` base color that is adapted by the active light or dark theme. An object
|
|
38
96
|
* starts from those defaults and overrides only the supplied fields. Pass `false` to hide it.
|
|
39
97
|
*
|
|
40
|
-
* Read the current value from `builder.
|
|
98
|
+
* Read the current value from `builder.build().config.waterfall?.connector`.
|
|
41
99
|
*
|
|
42
100
|
* @param value `false` disables, `true` enables the default dashed style, and an object enables style overrides.
|
|
43
101
|
* @returns This builder for chaining.
|
|
44
102
|
* @example
|
|
45
103
|
* ```ts
|
|
46
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
47
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
48
104
|
* builder.setConnector(true);
|
|
49
|
-
* const connector = builder.
|
|
105
|
+
* const connector = builder.build().config.waterfall?.connector;
|
|
50
106
|
* ```
|
|
51
107
|
*/
|
|
52
108
|
setConnector(value: boolean | IChartWaterfallConnectorStyleSpec): this;
|
|
@@ -54,15 +110,13 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
54
110
|
* Clears connector configuration. With no persisted connector setting, the renderer does not
|
|
55
111
|
* draw connectors; call `setConnector(true)` to restore the default dashed connector.
|
|
56
112
|
*
|
|
57
|
-
* Read the cleared value from `builder.
|
|
113
|
+
* Read the cleared value from `builder.build().config.waterfall?.connector`.
|
|
58
114
|
*
|
|
59
115
|
* @returns This builder for chaining.
|
|
60
116
|
* @example
|
|
61
117
|
* ```ts
|
|
62
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
63
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
64
118
|
* builder.clearConnector();
|
|
65
|
-
* const connector = builder.
|
|
119
|
+
* const connector = builder.build().config.waterfall?.connector;
|
|
66
120
|
* ```
|
|
67
121
|
*/
|
|
68
122
|
clearConnector(): this;
|
|
@@ -75,9 +129,7 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
75
129
|
* @returns This builder for chaining.
|
|
76
130
|
* @example
|
|
77
131
|
* ```ts
|
|
78
|
-
*
|
|
79
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
80
|
-
* builder.setStackType(univerAPI.Enum.WaterfallStackTypeEnum.Arrangement);
|
|
132
|
+
* builder.setStackType(univerAPI.Enum.ChartWaterfallStackTypeEnum.Arrangement);
|
|
81
133
|
* ```
|
|
82
134
|
*/
|
|
83
135
|
setStackType(value: WaterfallStackTypeEnum): this;
|
|
@@ -89,8 +141,6 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
89
141
|
* @returns This builder for chaining.
|
|
90
142
|
* @example
|
|
91
143
|
* ```ts
|
|
92
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
93
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
94
144
|
* builder.resetStackType();
|
|
95
145
|
* ```
|
|
96
146
|
*/
|
|
@@ -104,8 +154,6 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
104
154
|
* @returns This builder for chaining.
|
|
105
155
|
* @example
|
|
106
156
|
* ```ts
|
|
107
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
108
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
109
157
|
* builder.setUseSubtotal(true);
|
|
110
158
|
* ```
|
|
111
159
|
*/
|
|
@@ -118,8 +166,6 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
118
166
|
* @returns This builder for chaining.
|
|
119
167
|
* @example
|
|
120
168
|
* ```ts
|
|
121
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
122
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
123
169
|
* builder.resetUseSubtotal();
|
|
124
170
|
* ```
|
|
125
171
|
*/
|
|
@@ -134,10 +180,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
134
180
|
* @returns This builder for chaining.
|
|
135
181
|
* @example
|
|
136
182
|
* ```ts
|
|
137
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
138
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
139
183
|
* builder.setPositiveStyle(0, { color: '#52c41a' });
|
|
140
|
-
* const positive = builder.
|
|
184
|
+
* const positive = builder.build().config.series[0]?.waterfallStyles?.positive;
|
|
141
185
|
* ```
|
|
142
186
|
*/
|
|
143
187
|
setPositiveStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
|
|
@@ -150,10 +194,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
150
194
|
* @returns This builder for chaining.
|
|
151
195
|
* @example
|
|
152
196
|
* ```ts
|
|
153
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
154
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
155
197
|
* builder.clearPositiveStyle(0);
|
|
156
|
-
* const positive = builder.
|
|
198
|
+
* const positive = builder.build().config.series[0]?.waterfallStyles?.positive;
|
|
157
199
|
* ```
|
|
158
200
|
*/
|
|
159
201
|
clearPositiveStyle(selector: ChartPublicSeriesSelector): this;
|
|
@@ -167,10 +209,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
167
209
|
* @returns This builder for chaining.
|
|
168
210
|
* @example
|
|
169
211
|
* ```ts
|
|
170
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
171
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
172
212
|
* builder.setNegativeStyle(0, { color: '#f5222d' });
|
|
173
|
-
* const negative = builder.
|
|
213
|
+
* const negative = builder.build().config.series[0]?.waterfallStyles?.negative;
|
|
174
214
|
* ```
|
|
175
215
|
*/
|
|
176
216
|
setNegativeStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
|
|
@@ -183,10 +223,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
183
223
|
* @returns This builder for chaining.
|
|
184
224
|
* @example
|
|
185
225
|
* ```ts
|
|
186
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
187
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
188
226
|
* builder.clearNegativeStyle(0);
|
|
189
|
-
* const negative = builder.
|
|
227
|
+
* const negative = builder.build().config.series[0]?.waterfallStyles?.negative;
|
|
190
228
|
* ```
|
|
191
229
|
*/
|
|
192
230
|
clearNegativeStyle(selector: ChartPublicSeriesSelector): this;
|
|
@@ -200,10 +238,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
200
238
|
* @returns This builder for chaining.
|
|
201
239
|
* @example
|
|
202
240
|
* ```ts
|
|
203
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
204
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
205
241
|
* builder.setSubtotalStyle(0, { color: '#1677ff' });
|
|
206
|
-
* const subtotal = builder.
|
|
242
|
+
* const subtotal = builder.build().config.series[0]?.waterfallStyles?.subtotal;
|
|
207
243
|
* ```
|
|
208
244
|
*/
|
|
209
245
|
setSubtotalStyle(selector: ChartPublicSeriesSelector, value: Omit<IChartSeriesPatch, 'selector'>): this;
|
|
@@ -216,10 +252,8 @@ export declare class FWaterfallChartBuilder extends FCartesianChartBuilder {
|
|
|
216
252
|
* @returns This builder for chaining.
|
|
217
253
|
* @example
|
|
218
254
|
* ```ts
|
|
219
|
-
* const worksheet = univerAPI.getActiveWorkbook().getActiveSheet();
|
|
220
|
-
* const builder = worksheet.charts.create().setType(univerAPI.Enum.ChartTypeString.Waterfall);
|
|
221
255
|
* builder.clearSubtotalStyle(0);
|
|
222
|
-
* const subtotal = builder.
|
|
256
|
+
* const subtotal = builder.build().config.series[0]?.waterfallStyles?.subtotal;
|
|
223
257
|
* ```
|
|
224
258
|
*/
|
|
225
259
|
clearSubtotalStyle(selector: ChartPublicSeriesSelector): this;
|