【v5】interaction 下面的动作配置文档不全 #5365
Answered
by
pearmini
Deathsteps
asked this question in
Q&A
-
![]() 试了一堆写法,愣是没找到对的写,是不是就没有支持 😓 {
background: true,
backgroundFill: '#F00',
backgroundStyle: {
fill: '#F00',
},
style: {
fill: '#F00',
backgroundFill: '#F00',
background: {
fill: '#F00'
}
}
} |
Beta Was this translation helpful? Give feedback.
Answered by
pearmini
Aug 25, 2023
Replies: 2 comments 1 reply
-
文档有点问题,这个是属于 element 的状态,需要如下配置: import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
theme: 'classic',
autoFit: true,
});
chart
.interval()
.data({
type: 'fetch',
value:
'https://gw.alipayobjects.com/os/bmw-prod/fb9db6b7-23a5-4c23-bbef-c54a55fee580.csv',
})
.transform([{ type: 'sortX', by: 'y', reverse: true, slice: 5 }])
.encode('x', 'letter')
.encode('y', 'frequency')
.axis('y', { labelFormatter: '.0%' })
.state('active', {backgroundFill:'red'}) // 这里
.interaction('elementHighlight', { background: true });
chart.render(); |
Beta Was this translation helpful? Give feedback.
0 replies
Answer selected by
pearmini
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
文档有点问题,这个是属于 element 的状态,需要如下配置: