条形图的背景有属性吗? #5110
Unanswered
Pentium286
asked this question in
Q&A
条形图的背景有属性吗?
#5110
Replies: 1 comment
-
原则就是使用图形去模拟背景,而不是直接设置背景。举个栗子: // 这里是背景 shape
chart
.interval()
.encode('x', 'month')
.encode('y', () => 1)
.scale('y', { independent: true, domain: [0, 1] })
.scale('x', { independent: true })
.axis('y', false)
.axis('x', false)
.style('fill', 'red')
.style('opacity', '0.1')
.style('pointerEvents', 'none') // 不响应事件
; 也可以直接看官网在线 DEMO。 |
Beta Was this translation helpful? Give feedback.
0 replies
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
-
G2plot里有,但是和G2的设置的数据结构不一样
Beta Was this translation helpful? Give feedback.
All reactions