File tree 3 files changed +38
-0
lines changed
3 files changed +38
-0
lines changed Original file line number Diff line number Diff line change
1
+ import { COMPONENT_TYPE } from '@antv/g2/lib/constant' ;
2
+ import { Line } from '../../src' ;
3
+ import { createDiv } from '.././utils/dom' ;
4
+
5
+ describe ( '#968' , ( ) => {
6
+ it ( 'axis type' , ( ) => {
7
+ const data = [
8
+ { year : '1991' , value : 3 } ,
9
+ { year : '1992' , value : 4 } ,
10
+ { year : '1993' , value : 3.5 } ,
11
+ { year : '1994' , value : 5 } ,
12
+ { year : '1995' , value : 4.9 } ,
13
+ { year : '1996' , value : 6 } ,
14
+ { year : '1997' , value : 7 } ,
15
+ { year : '1998' , value : 9 } ,
16
+ { year : '1999' , value : 13 } ,
17
+ ] ;
18
+
19
+ const line = new Line ( createDiv ( ) , {
20
+ data,
21
+ xField : 'year' ,
22
+ yField : 'value' ,
23
+ height : 300 ,
24
+ yAxis : {
25
+ type : 'log' ,
26
+ } ,
27
+ } ) ;
28
+
29
+ line . render ( ) ;
30
+
31
+ expect ( line . chart . getYScales ( ) [ 0 ] . type ) . toBe ( 'log' ) ;
32
+ } ) ;
33
+ } ) ;
Original file line number Diff line number Diff line change 2
2
* 需要从轴配置中提取出来作为 meta 的属性 key 列表
3
3
*/
4
4
export const AXIS_META_CONFIG_KEYS = [
5
+ 'type' ,
5
6
'tickCount' ,
6
7
'tickInterval' ,
7
8
'min' ,
Original file line number Diff line number Diff line change 1
1
import { AxisOption } from '@antv/g2/lib/interface' ;
2
2
3
3
export type Axis = AxisOption & {
4
+ /**
5
+ * 坐标轴类型
6
+ */
7
+ readonly type ?: string ;
4
8
/**
5
9
* 是否美化
6
10
*/
You can’t perform that action at this time.
0 commit comments