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