@orbcharts/presets-basic 3.0.0-beta.1 → 3.0.0-beta.3

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.
Files changed (55) hide show
  1. package/LICENSE +200 -200
  2. package/lib/core-types.ts +7 -7
  3. package/lib/plugins-basic-types.ts +6 -6
  4. package/package.json +42 -42
  5. package/src/grid/PRESET_BARS_HORIZONTAL_AND_ROUND.ts +56 -56
  6. package/src/grid/PRESET_BARS_HORIZONTAL_AND_THIN.ts +52 -52
  7. package/src/grid/PRESET_BARS_ROUND.ts +39 -39
  8. package/src/grid/PRESET_BARS_THIN.ts +36 -36
  9. package/src/grid/PRESET_GRID_BASIC.ts +27 -27
  10. package/src/grid/PRESET_GRID_HORIZONTAL.ts +44 -44
  11. package/src/grid/PRESET_GRID_PN_SCALE.ts +35 -35
  12. package/src/grid/PRESET_GRID_ROTATE_AXIS_LABEL.ts +35 -35
  13. package/src/grid/PRESET_GRID_SEPARATE_SERIES.ts +40 -40
  14. package/src/grid/PRESET_LINES_BASIC.ts +35 -35
  15. package/src/grid/PRESET_LINES_CURVE.ts +38 -38
  16. package/src/grid/PRESET_LINES_HIGHLIGHT_GROUP_DOTS.ts +37 -37
  17. package/src/grid/PRESET_LINES_HORIZONTAL.ts +51 -51
  18. package/src/grid/PRESET_LINES_LOOSE_TICKS.ts +37 -37
  19. package/src/grid/PRESET_LINES_ROTATE_AXIS_LABEL.ts +40 -40
  20. package/src/grid/PRESET_LINES_WITH_SOLID_DOTS.ts +39 -39
  21. package/src/grid/PRESET_LINE_AREAS_BASIC.ts +43 -43
  22. package/src/grid/PRESET_LINE_AREAS_CURVE.ts +48 -48
  23. package/src/grid/PRESET_LINE_AREAS_HIGHLIGHT_GROUP_DOTS.ts +47 -47
  24. package/src/grid/PRESET_LINE_AREAS_HORIZONTAL.ts +47 -47
  25. package/src/grid/PRESET_LINE_AREAS_LOOSE_TICKS.ts +45 -45
  26. package/src/grid/PRESET_LINE_AREAS_ROTATE_AXIS_LABEL.ts +48 -48
  27. package/src/grid/PRESET_LINE_AREAS_SEPARATE_SERIES.ts +50 -50
  28. package/src/grid/index.ts +22 -22
  29. package/src/index.ts +4 -4
  30. package/src/multiGrid/PRESET_MULTI_GRID_BASIC.ts +38 -38
  31. package/src/multiGrid/PRESET_MULTI_GRID_DIVERGING.ts +86 -86
  32. package/src/multiGrid/PRESET_MULTI_GRID_ROUND_STYLE.ts +58 -58
  33. package/src/multiGrid/PRESET_MULTI_GRID_SEPARATE_GRID.ts +60 -60
  34. package/src/multiGrid/PRESET_MULTI_LINES_SEPARATE_GRID.ts +86 -86
  35. package/src/multiGrid/PRESET_MULTI_LINE_AREAS_SEPARATE_GRID.ts +104 -104
  36. package/src/multiGrid/index.ts +6 -6
  37. package/src/params.ts +60 -60
  38. package/src/series/PRESET_BUBBLES_SCALING_BY_RADIUS.ts +18 -18
  39. package/src/series/PRESET_BUBBLES_SEPARATE_SERIES.ts +29 -29
  40. package/src/series/PRESET_PIE_BASIC.ts +18 -18
  41. package/src/series/PRESET_PIE_DONUT.ts +23 -23
  42. package/src/series/PRESET_PIE_HALF_DONUT.ts +36 -36
  43. package/src/series/PRESET_PIE_WITH_INNER_LABELS.ts +24 -24
  44. package/src/series/PRESET_ROSE_BASIC.ts +19 -19
  45. package/src/series/PRESET_ROSE_SCALING_BY_RADIUS.ts +24 -24
  46. package/src/series/PRESET_SERIES_BASIC.ts +16 -16
  47. package/src/series/PRESET_SERIES_SEPARATE_SERIES.ts +17 -17
  48. package/src/series/PRESET_SERIES_SEPARATE_SERIES_AND_SUM_SERIES.ts +18 -18
  49. package/src/series/PRESET_SERIES_SUM_SERIES.ts +18 -18
  50. package/src/series/index.ts +13 -13
  51. package/src/tree/PRESET_TREE_BASIC.ts +27 -27
  52. package/src/types.ts +267 -267
  53. package/tsconfig.base.json +13 -13
  54. package/tsconfig.json +2 -2
  55. package/vite.config.js +22 -22
@@ -1,104 +1,104 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type {
3
- PresetMultiGridPluginParams,
4
- PresetNoneDataPluginParams
5
- } from '../types'
6
- import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
7
-
8
- export const PRESET_MULTI_LINE_AREAS_SEPARATE_GRID: PresetPartial<'multiGrid', Partial<PresetMultiGridPluginParams>
9
- & Partial<PresetNoneDataPluginParams>> = {
10
- name: 'PRESET_MULTI_LINE_AREAS_SEPARATE_GRID',
11
- description: '2組區域圖表',
12
- chartParams: {
13
- padding: {
14
- top: 60,
15
- right: 60,
16
- bottom: 160,
17
- left: 60
18
- },
19
- },
20
- dataFormatter: {
21
- gridList: [
22
- {
23
- // slotIndex: 0
24
- groupAxis: {
25
- scalePadding: 0
26
- }
27
- },
28
- {
29
- // slotIndex: 1,
30
- groupAxis: {
31
- scalePadding: 0
32
- }
33
- }
34
- ],
35
- separateGrid: true,
36
- // container: {
37
- // rowAmount: 1,
38
- // columnAmount: 2,
39
- // }
40
- },
41
- allPluginParams: {
42
- ...ALL_PLUGIN_PARAMS_NONE_DATA,
43
- MultiGroupAxis: {
44
- tickTextRotate: -30,
45
- gridIndexes: 'all'
46
- },
47
- MultiValueAxis: {
48
- gridIndexes: 'all'
49
- },
50
- MultiValueStackAxis: {
51
- gridIndexes: 'all'
52
- },
53
- MultiBars: {
54
- gridIndexes: 'all'
55
- },
56
- MultiBarStack: {
57
- gridIndexes: 'all'
58
- },
59
- MultiBarsTriangle: {
60
- gridIndexes: 'all'
61
- },
62
- MultiLines: {
63
- gridIndexes: 'all'
64
- },
65
- MultiLineAreas: {
66
- gridIndexes: 'all'
67
- },
68
- MultiDots: {
69
- gridIndexes: 'all'
70
- },
71
- MultiGridLegend: {
72
- // position: 'bottom',
73
- // justify: 'center',
74
- placement: 'bottom',
75
- padding: 14,
76
- gridList: [
77
- {
78
- listRectHeight: 2,
79
- },
80
- {
81
- listRectHeight: 2,
82
- },
83
- {
84
- listRectHeight: 2,
85
- },
86
- {
87
- listRectHeight: 2,
88
- },
89
- {
90
- listRectHeight: 2,
91
- },
92
- {
93
- listRectHeight: 2,
94
- },
95
- {
96
- listRectHeight: 2,
97
- },
98
- {
99
- listRectHeight: 2,
100
- }
101
- ]
102
- }
103
- }
104
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type {
3
+ PresetMultiGridPluginParams,
4
+ PresetNoneDataPluginParams
5
+ } from '../types'
6
+ import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
7
+
8
+ export const PRESET_MULTI_LINE_AREAS_SEPARATE_GRID: PresetPartial<'multiGrid', Partial<PresetMultiGridPluginParams>
9
+ & Partial<PresetNoneDataPluginParams>> = {
10
+ name: 'PRESET_MULTI_LINE_AREAS_SEPARATE_GRID',
11
+ description: '2組區域圖表',
12
+ chartParams: {
13
+ padding: {
14
+ top: 60,
15
+ right: 60,
16
+ bottom: 160,
17
+ left: 60
18
+ },
19
+ },
20
+ dataFormatter: {
21
+ gridList: [
22
+ {
23
+ // slotIndex: 0
24
+ groupAxis: {
25
+ scalePadding: 0
26
+ }
27
+ },
28
+ {
29
+ // slotIndex: 1,
30
+ groupAxis: {
31
+ scalePadding: 0
32
+ }
33
+ }
34
+ ],
35
+ separateGrid: true,
36
+ // container: {
37
+ // rowAmount: 1,
38
+ // columnAmount: 2,
39
+ // }
40
+ },
41
+ allPluginParams: {
42
+ ...ALL_PLUGIN_PARAMS_NONE_DATA,
43
+ MultiGroupAxis: {
44
+ tickTextRotate: -30,
45
+ gridIndexes: 'all'
46
+ },
47
+ MultiValueAxis: {
48
+ gridIndexes: 'all'
49
+ },
50
+ MultiValueStackAxis: {
51
+ gridIndexes: 'all'
52
+ },
53
+ MultiBars: {
54
+ gridIndexes: 'all'
55
+ },
56
+ MultiBarStack: {
57
+ gridIndexes: 'all'
58
+ },
59
+ MultiBarsTriangle: {
60
+ gridIndexes: 'all'
61
+ },
62
+ MultiLines: {
63
+ gridIndexes: 'all'
64
+ },
65
+ MultiLineAreas: {
66
+ gridIndexes: 'all'
67
+ },
68
+ MultiDots: {
69
+ gridIndexes: 'all'
70
+ },
71
+ MultiGridLegend: {
72
+ // position: 'bottom',
73
+ // justify: 'center',
74
+ placement: 'bottom',
75
+ padding: 14,
76
+ gridList: [
77
+ {
78
+ listRectHeight: 2,
79
+ },
80
+ {
81
+ listRectHeight: 2,
82
+ },
83
+ {
84
+ listRectHeight: 2,
85
+ },
86
+ {
87
+ listRectHeight: 2,
88
+ },
89
+ {
90
+ listRectHeight: 2,
91
+ },
92
+ {
93
+ listRectHeight: 2,
94
+ },
95
+ {
96
+ listRectHeight: 2,
97
+ },
98
+ {
99
+ listRectHeight: 2,
100
+ }
101
+ ]
102
+ }
103
+ }
104
+ }
@@ -1,6 +1,6 @@
1
- export { PRESET_MULTI_GRID_BASIC } from './PRESET_MULTI_GRID_BASIC'
2
- export { PRESET_MULTI_GRID_DIVERGING } from './PRESET_MULTI_GRID_DIVERGING'
3
- export { PRESET_MULTI_GRID_ROUND_STYLE } from './PRESET_MULTI_GRID_ROUND_STYLE'
4
- export { PRESET_MULTI_GRID_SEPARATE_GRID } from './PRESET_MULTI_GRID_SEPARATE_GRID'
5
- export { PRESET_MULTI_LINE_AREAS_SEPARATE_GRID } from './PRESET_MULTI_LINE_AREAS_SEPARATE_GRID'
6
- export { PRESET_MULTI_LINES_SEPARATE_GRID } from './PRESET_MULTI_LINES_SEPARATE_GRID'
1
+ export { PRESET_MULTI_GRID_BASIC } from './PRESET_MULTI_GRID_BASIC'
2
+ export { PRESET_MULTI_GRID_DIVERGING } from './PRESET_MULTI_GRID_DIVERGING'
3
+ export { PRESET_MULTI_GRID_ROUND_STYLE } from './PRESET_MULTI_GRID_ROUND_STYLE'
4
+ export { PRESET_MULTI_GRID_SEPARATE_GRID } from './PRESET_MULTI_GRID_SEPARATE_GRID'
5
+ export { PRESET_MULTI_LINE_AREAS_SEPARATE_GRID } from './PRESET_MULTI_LINE_AREAS_SEPARATE_GRID'
6
+ export { PRESET_MULTI_LINES_SEPARATE_GRID } from './PRESET_MULTI_LINES_SEPARATE_GRID'
package/src/params.ts CHANGED
@@ -1,61 +1,61 @@
1
- import type {
2
- PresetSeriesPluginParams,
3
- PresetGridPluginParams,
4
- PresetMultiGridPluginParams,
5
- PresetTreePluginParams,
6
- PresetNoneDataPluginParams
7
- } from './types'
8
-
9
- export const ALL_PLUGIN_PARAMS_SERIES: PresetSeriesPluginParams = {
10
- Bubbles: {},
11
- Pie: {},
12
- PieEventTexts: {},
13
- PieLabels: {},
14
- Rose: {},
15
- RoseLabels: {},
16
- SeriesLegend: {},
17
- SeriesTooltip: {},
18
- }
19
-
20
- export const ALL_PLUGIN_PARAMS_GRID: PresetGridPluginParams = {
21
- Bars: {},
22
- BarsPN: {},
23
- BarStack: {},
24
- BarsTriangle: {},
25
- Dots: {},
26
- GridLegend: {},
27
- GridTooltip: {},
28
- GroupAux: {},
29
- GroupAxis: {},
30
- LineAreas: {},
31
- Lines: {},
32
- GridZoom: {},
33
- ValueAxis: {},
34
- ValueStackAxis: {},
35
- }
36
-
37
- export const ALL_PLUGIN_PARAMS_MULTI_GRID: PresetMultiGridPluginParams = {
38
- MultiBars: {},
39
- MultiBarStack: {},
40
- MultiBarsTriangle: {},
41
- MultiDots: {},
42
- MultiGridLegend: {},
43
- MultiGridTooltip: {},
44
- MultiGroupAxis: {},
45
- MultiLineAreas: {},
46
- MultiLines: {},
47
- MultiValueAxis: {},
48
- MultiValueStackAxis: {},
49
- OverlappingValueAxes: {},
50
- OverlappingValueStackAxes: {},
51
- }
52
-
53
- export const ALL_PLUGIN_PARAMS_TREE: PresetTreePluginParams = {
54
- TreeLegend: {},
55
- TreeMap: {},
56
- TreeTooltip: {},
57
- }
58
-
59
- export const ALL_PLUGIN_PARAMS_NONE_DATA: PresetNoneDataPluginParams = {
60
- // Tooltip: {},
1
+ import type {
2
+ PresetSeriesPluginParams,
3
+ PresetGridPluginParams,
4
+ PresetMultiGridPluginParams,
5
+ PresetTreePluginParams,
6
+ PresetNoneDataPluginParams
7
+ } from './types'
8
+
9
+ export const ALL_PLUGIN_PARAMS_SERIES: PresetSeriesPluginParams = {
10
+ Bubbles: {},
11
+ Pie: {},
12
+ PieEventTexts: {},
13
+ PieLabels: {},
14
+ Rose: {},
15
+ RoseLabels: {},
16
+ SeriesLegend: {},
17
+ SeriesTooltip: {},
18
+ }
19
+
20
+ export const ALL_PLUGIN_PARAMS_GRID: PresetGridPluginParams = {
21
+ Bars: {},
22
+ BarsPN: {},
23
+ BarStack: {},
24
+ BarsTriangle: {},
25
+ Dots: {},
26
+ GridLegend: {},
27
+ GridTooltip: {},
28
+ GroupAux: {},
29
+ GroupAxis: {},
30
+ LineAreas: {},
31
+ Lines: {},
32
+ GridZoom: {},
33
+ ValueAxis: {},
34
+ ValueStackAxis: {},
35
+ }
36
+
37
+ export const ALL_PLUGIN_PARAMS_MULTI_GRID: PresetMultiGridPluginParams = {
38
+ MultiBars: {},
39
+ MultiBarStack: {},
40
+ MultiBarsTriangle: {},
41
+ MultiDots: {},
42
+ MultiGridLegend: {},
43
+ MultiGridTooltip: {},
44
+ MultiGroupAxis: {},
45
+ MultiLineAreas: {},
46
+ MultiLines: {},
47
+ MultiValueAxis: {},
48
+ MultiValueStackAxis: {},
49
+ OverlappingValueAxes: {},
50
+ OverlappingValueStackAxes: {},
51
+ }
52
+
53
+ export const ALL_PLUGIN_PARAMS_TREE: PresetTreePluginParams = {
54
+ TreeLegend: {},
55
+ TreeMap: {},
56
+ TreeTooltip: {},
57
+ }
58
+
59
+ export const ALL_PLUGIN_PARAMS_NONE_DATA: PresetNoneDataPluginParams = {
60
+ // Tooltip: {},
61
61
  }
@@ -1,18 +1,18 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetBubblesParams, PresetSeriesLegendParams, PresetSeriesTooltipParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_BUBBLES_SCALING_BY_RADIUS: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_BUBBLES_SCALING_BY_RADIUS',
8
- description: '以半徑尺寸為比例的泡泡圖',
9
- allPluginParams: {
10
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
11
- Bubbles: {
12
- arcScaleType: 'radius'
13
- },
14
- SeriesLegend: {
15
- listRectRadius: 7 // 圓型圖例列點
16
- },
17
- },
18
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetBubblesParams, PresetSeriesLegendParams, PresetSeriesTooltipParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_BUBBLES_SCALING_BY_RADIUS: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_BUBBLES_SCALING_BY_RADIUS',
8
+ description: '以半徑尺寸為比例的泡泡圖',
9
+ allPluginParams: {
10
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
11
+ Bubbles: {
12
+ arcScaleType: 'radius'
13
+ },
14
+ SeriesLegend: {
15
+ listRectRadius: 7 // 圓型圖例列點
16
+ },
17
+ },
18
+ }
@@ -1,29 +1,29 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_BUBBLES_SEPARATE_SERIES: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_BUBBLES_SEPARATE_SERIES',
8
- description: '分開顯示Series泡泡',
9
- chartParams: {
10
- // 加長留空
11
- padding: {
12
- top: 160,
13
- right: 160,
14
- bottom: 160,
15
- left: 160
16
- },
17
- },
18
- dataFormatter: {
19
- separateSeries: true,
20
- },
21
- allPluginParams: {
22
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
23
- Bubbles: {},
24
- SeriesLegend: {
25
- listRectRadius: 7 // 圓型圖例列點
26
- },
27
- SeriesTooltip: {}
28
- }
29
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_BUBBLES_SEPARATE_SERIES: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_BUBBLES_SEPARATE_SERIES',
8
+ description: '分開顯示Series泡泡',
9
+ chartParams: {
10
+ // 加長留空
11
+ padding: {
12
+ top: 160,
13
+ right: 160,
14
+ bottom: 160,
15
+ left: 160
16
+ },
17
+ },
18
+ dataFormatter: {
19
+ separateSeries: true,
20
+ },
21
+ allPluginParams: {
22
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
23
+ Bubbles: {},
24
+ SeriesLegend: {
25
+ listRectRadius: 7 // 圓型圖例列點
26
+ },
27
+ SeriesTooltip: {}
28
+ }
29
+ }
@@ -1,19 +1,19 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetSeriesTooltipParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_PIE_BASIC: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_PIE_BASIC',
8
- description: '基本Pie參數',
9
- dataFormatter: {
10
- sort: (a, b) => b.value - a.value
11
- },
12
- allPluginParams: {
13
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
- SeriesLegend: {
15
- listRectRadius: 7 // 圓型圖例列點
16
- }
17
- }
18
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetSeriesTooltipParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_SERIES, ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_BASIC: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_PIE_BASIC',
8
+ description: '基本Pie參數',
9
+ dataFormatter: {
10
+ sort: (a, b) => b.value - a.value
11
+ },
12
+ allPluginParams: {
13
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
+ SeriesLegend: {
15
+ listRectRadius: 7 // 圓型圖例列點
16
+ }
17
+ }
18
+ }
19
19
  PRESET_PIE_BASIC.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -1,24 +1,24 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_PIE_DONUT: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_PIE_DONUT',
8
- description: '甜甜圈圖',
9
- dataFormatter: {
10
- sort: (a, b) => b.value - a.value
11
- },
12
- allPluginParams: {
13
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
- Pie: {
15
- innerRadius: 0.5
16
- },
17
- PieLabels: {},
18
- PieEventTexts: {},
19
- SeriesLegend: {
20
- listRectRadius: 7 // 圓型圖例列點
21
- }
22
- }
23
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_DONUT: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_PIE_DONUT',
8
+ description: '甜甜圈圖',
9
+ dataFormatter: {
10
+ sort: (a, b) => b.value - a.value
11
+ },
12
+ allPluginParams: {
13
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
+ Pie: {
15
+ innerRadius: 0.5
16
+ },
17
+ PieLabels: {},
18
+ PieEventTexts: {},
19
+ SeriesLegend: {
20
+ listRectRadius: 7 // 圓型圖例列點
21
+ }
22
+ }
23
+ }
24
24
  PRESET_PIE_DONUT.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -1,37 +1,37 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_PIE_HALF_DONUT: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_PIE_HALF_DONUT',
8
- description: '半圓甜甜圈圖',
9
- chartParams: {
10
- padding: {
11
- top: 120,
12
- right: 120,
13
- bottom: 0,
14
- left: 60
15
- },
16
- },
17
- dataFormatter: {
18
- sort: (a, b) => b.value - a.value
19
- },
20
- allPluginParams: {
21
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
22
- Pie: {
23
- innerRadius: 0.5,
24
- startAngle: - Math.PI / 2,
25
- endAngle: Math.PI / 2,
26
- },
27
- PieLabels: {
28
- startAngle: - Math.PI / 2,
29
- endAngle: Math.PI / 2,
30
- },
31
- PieEventTexts: {},
32
- SeriesLegend: {
33
- listRectRadius: 7 // 圓型圖例列點
34
- }
35
- }
36
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_HALF_DONUT: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_PIE_HALF_DONUT',
8
+ description: '半圓甜甜圈圖',
9
+ chartParams: {
10
+ padding: {
11
+ top: 120,
12
+ right: 120,
13
+ bottom: 0,
14
+ left: 60
15
+ },
16
+ },
17
+ dataFormatter: {
18
+ sort: (a, b) => b.value - a.value
19
+ },
20
+ allPluginParams: {
21
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
22
+ Pie: {
23
+ innerRadius: 0.5,
24
+ startAngle: - Math.PI / 2,
25
+ endAngle: Math.PI / 2,
26
+ },
27
+ PieLabels: {
28
+ startAngle: - Math.PI / 2,
29
+ endAngle: Math.PI / 2,
30
+ },
31
+ PieEventTexts: {},
32
+ SeriesLegend: {
33
+ listRectRadius: 7 // 圓型圖例列點
34
+ }
35
+ }
36
+ }
37
37
  PRESET_PIE_HALF_DONUT.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`
@@ -1,25 +1,25 @@
1
- import type { PresetPartial } from '../../lib/core-types'
2
- import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
- // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
-
5
- export const PRESET_PIE_WITH_INNER_LABELS: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
- & Partial<PresetNoneDataPluginParams>> = {
7
- name: 'PRESET_PIE_WITH_INNER_LABELS',
8
- description: '圓餅圖及內部資料標籤',
9
- dataFormatter: {
10
- sort: (a, b) => b.value - a.value
11
- },
12
- allPluginParams: {
13
- // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
- Pie: {},
15
- PieLabels: {
16
- "labelCentroid": 1.3, // 圖內資料標籤
17
- "labelColorType": "primary"
18
- },
19
- PieEventTexts: {},
20
- SeriesLegend: {
21
- listRectRadius: 7 // 圓型圖例列點
22
- }
23
- }
24
- }
1
+ import type { PresetPartial } from '../../lib/core-types'
2
+ import type { PresetSeriesPluginParams, PresetNoneDataPluginParams } from '../types'
3
+ // import { ALL_PLUGIN_PARAMS_NONE_DATA } from '../params'
4
+
5
+ export const PRESET_PIE_WITH_INNER_LABELS: PresetPartial<'series', Partial<PresetSeriesPluginParams>
6
+ & Partial<PresetNoneDataPluginParams>> = {
7
+ name: 'PRESET_PIE_WITH_INNER_LABELS',
8
+ description: '圓餅圖及內部資料標籤',
9
+ dataFormatter: {
10
+ sort: (a, b) => b.value - a.value
11
+ },
12
+ allPluginParams: {
13
+ // ...ALL_PLUGIN_PARAMS_NONE_DATA,
14
+ Pie: {},
15
+ PieLabels: {
16
+ "labelCentroid": 1.3, // 圖內資料標籤
17
+ "labelColorType": "primary"
18
+ },
19
+ PieEventTexts: {},
20
+ SeriesLegend: {
21
+ listRectRadius: 7 // 圓型圖例列點
22
+ }
23
+ }
24
+ }
25
25
  PRESET_PIE_WITH_INNER_LABELS.dataFormatter.sort.toString = () => `(a, b) => b.value - a.value`