File tree Expand file tree Collapse file tree 1 file changed +49
-0
lines changed
client/packages/lowcoder-comps/src/comps/chartComp/chartConfigs Expand file tree Collapse file tree 1 file changed +49
-0
lines changed Original file line number Diff line number Diff line change
1
+ import {
2
+ AlignClose ,
3
+ AlignRight ,
4
+ AlignLeft ,
5
+ dropdownControl ,
6
+ MultiCompBuilder ,
7
+ } from "lowcoder-sdk" ;
8
+ import { LegendComponentOption } from "echarts" ;
9
+ import { trans } from "i18n/comps" ;
10
+
11
+ const TitlePositionOptions = [
12
+ {
13
+ label : < AlignClose /> ,
14
+ value : "center" ,
15
+ } ,
16
+ {
17
+ label : < AlignRight /> ,
18
+ value : "right" ,
19
+ } ,
20
+ {
21
+ label : < AlignLeft /> ,
22
+ value : "left" ,
23
+ } ,
24
+ ] as const ;
25
+
26
+ export const EchartsTitleConfig = ( function ( ) {
27
+ return new MultiCompBuilder (
28
+ {
29
+ position : dropdownControl ( TitlePositionOptions , "center" ) ,
30
+ } ,
31
+ ( props ) : LegendComponentOption => {
32
+ const config : LegendComponentOption = {
33
+ top : "center" ,
34
+ type : "scroll" ,
35
+ } ;
36
+ config . top = props . position
37
+ return config ;
38
+ }
39
+ )
40
+ . setPropertyViewFn ( ( children ) => (
41
+ < >
42
+ { children . position . propertyView ( {
43
+ label : trans ( "echarts.titlePosition" ) ,
44
+ radioButton : true ,
45
+ } ) }
46
+ </ >
47
+ ) )
48
+ . build ( ) ;
49
+ } ) ( ) ;
You can’t perform that action at this time.
0 commit comments