We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
https://g2.antv.vision/zh/examples/interaction/component#legend-active
import { Chart } from '@antv/g2';
// 默认已经加载 legend-active 交互 const data = [ { company: 'Apple', type: '整体', value: 1 }, { company: 'Facebook', type: '整体', value: 35 }, { company: 'Google', type: '整体', value: 28 }, { company: 'Apple', type: '非技术岗', value: 1 }, { company: 'Facebook', type: '非技术岗', value: 65 }, { company: 'Google', type: '非技术岗', value: 47 }, { company: 'Apple', type: '技术岗', value: 1 }, { company: 'Facebook', type: '技术岗', value: 18 }, { company: 'Google', type: '技术岗', value: 20 }, { company: 'Apple', type: '技术岗', value: 1 }, { company: 'Facebook', type: '技术岗', value: 30 }, { company: 'Google', type: '技术岗', value: 25 } ];
const chart = new Chart({ container: 'container', autoFit: true, limitInPlot: true, height: 500, });
chart.data(data);
chart.scale('value', { nice: true });
chart.legend({ position: 'top', radio: { style: { width: 12 } } });
chart .interval() .position('type*value').color('company') .adjust([{ type: 'dodge', marginRatio: 0 }]) .label('value', { layout: [ { type: 'interval-hide-overlap' }, { type: 'adjust-color' }, { type: 'limit-in-plot' }, ] });
chart.render();
The text was updated successfully, but these errors were encountered:
可以描述下 bug 是什么吗?
Sorry, something went wrong.
No branches or pull requests
Reproduction link
https://g2.antv.vision/zh/examples/interaction/component#legend-active
Steps to reproduce
import { Chart } from '@antv/g2';
// 默认已经加载 legend-active 交互
const data = [
{ company: 'Apple', type: '整体', value: 1 },
{ company: 'Facebook', type: '整体', value: 35 },
{ company: 'Google', type: '整体', value: 28 },
{ company: 'Apple', type: '非技术岗', value: 1 },
{ company: 'Facebook', type: '非技术岗', value: 65 },
{ company: 'Google', type: '非技术岗', value: 47 },
{ company: 'Apple', type: '技术岗', value: 1 },
{ company: 'Facebook', type: '技术岗', value: 18 },
{ company: 'Google', type: '技术岗', value: 20 },
{ company: 'Apple', type: '技术岗', value: 1 },
{ company: 'Facebook', type: '技术岗', value: 30 },
{ company: 'Google', type: '技术岗', value: 25 }
];
const chart = new Chart({
container: 'container',
autoFit: true,
limitInPlot: true,
height: 500,
});
chart.data(data);
chart.scale('value', {
nice: true
});
chart.legend({
position: 'top',
radio: {
style: {
width: 12
}
}
});
chart
.interval()
.position('type*value').color('company')
.adjust([{
type: 'dodge',
marginRatio: 0
}])
.label('value', {
layout: [
{ type: 'interval-hide-overlap' },
{ type: 'adjust-color' },
{ type: 'limit-in-plot' },
]
});
chart.render();
The text was updated successfully, but these errors were encountered: