Replies: 2 comments
-
把你的代码贴出来一下,方便我们调试和复现问题。 |
Beta Was this translation helpful? Give feedback.
0 replies
-
但是发现图例点击就会出现奇怪的bug 点一下图例 代码如下 import { Chart } from '@antv/g2';
const chart = new Chart({
container: 'container',
theme: 'classic',
width: 800,
height: 400,
paddingLeft: 60,
});
chart.options({
type: 'view',
paddingBottom: 30,
children: [
{
type: 'interval',
data: [
{ name: 'a', sex: 'male', country: 'A', value: 11 },
{ name: 'a', sex: 'male', country: 'B', value: 6 },
{ name: 'b', sex: 'male', country: 'A', value: 3 },
{ name: 'b', sex: 'male', country: 'B', value: 2 },
{ name: 'a', sex: 'female', country: 'A', value: 9 },
{ name: 'a', sex: 'female', country: 'B', value: 8 },
{ name: 'b', sex: 'female', country: 'A', value: 7 },
{ name: 'b', sex: 'female', country: 'B', value: 3 },
],
encode: {
x: 'name',
y:'value',
series:() => 'value',
color:'country',
size: 'sex'
},
scale:{
color:{
independent: true
},
size:{
independent: true,
range:[1,10]
}
}
},
{
type: 'interval',
data: [
{ name: 'a', sex: 'male', value: 10 },
{ name: 'a', sex: 'female', value: 2 },
{ name: 'b', sex: 'male', value: 6 },
{ name: 'b', sex: 'female', value: 3 },
],
encode: {
x: 'name',
y:'value',
series:() => 'value1',
color:'sex',
size:'value'
},
scale:{
color:{
independent: true
},
size:{
independent: true
}
},
axis: { x: { title: false } },
},
],
});
chart.render(); |
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
-
如图,每个度量设置不同的颜色大小通道,legend合并了。
可以每个度量单独设置,只对当前度量生效吗
Beta Was this translation helpful? Give feedback.
All reactions