Skip to content

堆叠图设置颜色 #5929

Answered by YY88Xu
YY88Xu asked this question in Q&A
Dec 13, 2023 · 3 comments · 1 reply
Discussion options

You must be logged in to vote

chart
.interval()
.data(data)
.transform({ type: 'stackY' })
.transform({ type: 'sortX', by: 'y', reverse: true })
.encode('x', 'month')
.encode('y', 'value')
.style('fill', (d) => d.color)

Replies: 3 comments 1 reply

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected by YY88Xu
Comment options

You must be logged in to vote
1 reply
@hustcc
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants
Converted from issue

This discussion was converted from issue #5928 on December 14, 2023 01:54.