Skip to content
New issue

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

🐛 [BUG] 混合图,柱状折线组合图表,只显示一个图例 #3784

Open
tclxzz08514 opened this issue May 31, 2024 · 1 comment
Open
Labels
Bug Something isn't working

Comments

@tclxzz08514
Copy link

import { Mix } from '@antv/g2plot';

const data = [
{ year: '1991', value: 3, category: '销量' },
{ year: '1992', value: 4, category: '销量' },
{ year: '1991', value: 2, category: '利润' },
{ year: '1992', value: 3, category: '利润' },
];

const mixPlot = new Mix('container', {
appendPadding: 8,
data,
plots: [
{
type: 'column',
options: {
data: data.filter((d) => d.category === '销量'),
xField: 'year',
yField: 'value',
seriesField: 'category',
},
},
{
type: 'line',
options: {
data: data.filter((d) => d.category === '利润'),
xField: 'year',
yField: 'value',
seriesField: 'category',
},
},
],
legend: {}
});

mixPlot.render();

@tclxzz08514 tclxzz08514 added the Bug Something isn't working label May 31, 2024
@tclxzz08514
Copy link
Author

使用不同的seriesField,显示两个图例又会不同行,也无法控制图例样式

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant