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? # for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? # to your account
柱状图与两条线形图的组合图形,原始状态分为三种颜色,chart.changeData后,线形图不能保持开始的颜色。代码如下:$('#btn')是刷新按钮 var data = [{ name: 'Jon', score: 282, avgScore: 94, value: 75 }, { name: 'Aaron', score: 208, avgScore: 41.6, value: 32 }, { name: 'Warren', score: 186, avgScore: 46.5, value: 88 }, { name: 'David', score: 184, avgScore: 30.67, value: 60 }, { name: 'Joel', score: 177, avgScore: 44.25, value: 70 }];
var chart = new F2.Chart({ id: 'mountNode', pixelRatio: window.devicePixelRatio, padding: ['auto', 'auto', 90, 'auto'] });
chart.source(data, { score: { tickInterval: 50, alias: '个人分数' }, avgScore: { ticks: [0, 17, 33, 50, 67, 83, 100], alias: '平均分数' }, value: { ticks: [0, 17, 33, 50, 67, 83, 100], alias: '历史分数' } }); chart.axis('avgScore', { grid: null }); chart.axis('value', { grid: null });
chart.interval().position('namescore').color('#0cc'); chart.line().position('namevalue').color('#ffc26a'); chart.line().position('name*avgScore').color('#ff7f8d'); chart.render(); $('#btn').click(function() { var res = [{ name: 'Jon', score: 282, avgScore: 94, value: 60 }, { name: 'Aaron', score: 208, avgScore: 41.6, value: 60 }, { name: 'Warren', score: 186, avgScore: 46.5, value: 60 }, { name: 'David', score: 184, avgScore: 30.67, value: 60 }, { name: 'Joel', score: 177, avgScore: 44.25, value: 60 }, { name: 'Kyle', score: 150, avgScore: 50, value: 60 }, { name: 'Jordan', score: 148, avgScore: 24.67, value: 80 }, { name: 'Jack', score: 138, avgScore: 34.5, value: 60 }, { name: 'Kuldeep', score: 130, avgScore: 32.5, value: 60 }, { name: 'Max', score: 128, avgScore: 32, value: 60 }, { name: 'Angus', score: 127, avgScore: 62.5, value: 60 }]; chart.changeData(res); }); 请问如何解决呢?
The text was updated successfully, but these errors were encountered:
ea7adc9
Merge pull request #319 from antvis/fix-issue-318
840edc5
fix: Optimized geometry shape's id generation strategy. Closed #318.
@antv/f2@3.2.3-beta.1 版本修复了这个问题!
Sorry, something went wrong.
simaQ
No branches or pull requests
柱状图与两条线形图的组合图形,原始状态分为三种颜色,chart.changeData后,线形图不能保持开始的颜色。代码如下:$('#btn')是刷新按钮
var data = [{
name: 'Jon',
score: 282,
avgScore: 94,
value: 75
}, {
name: 'Aaron',
score: 208,
avgScore: 41.6,
value: 32
}, {
name: 'Warren',
score: 186,
avgScore: 46.5,
value: 88
}, {
name: 'David',
score: 184,
avgScore: 30.67,
value: 60
}, {
name: 'Joel',
score: 177,
avgScore: 44.25,
value: 70
}];
var chart = new F2.Chart({
id: 'mountNode',
pixelRatio: window.devicePixelRatio,
padding: ['auto', 'auto', 90, 'auto']
});
chart.source(data, {
score: {
tickInterval: 50,
alias: '个人分数'
},
avgScore: {
ticks: [0, 17, 33, 50, 67, 83, 100],
alias: '平均分数'
},
value: {
ticks: [0, 17, 33, 50, 67, 83, 100],
alias: '历史分数'
}
});
chart.axis('avgScore', {
grid: null
});
chart.axis('value', {
grid: null
});
chart.interval().position('namescore').color('#0cc');
chart.line().position('namevalue').color('#ffc26a');
chart.line().position('name*avgScore').color('#ff7f8d');
chart.render();
$('#btn').click(function() {
var res = [{
name: 'Jon',
score: 282,
avgScore: 94,
value: 60
}, {
name: 'Aaron',
score: 208,
avgScore: 41.6,
value: 60
}, {
name: 'Warren',
score: 186,
avgScore: 46.5,
value: 60
}, {
name: 'David',
score: 184,
avgScore: 30.67,
value: 60
}, {
name: 'Joel',
score: 177,
avgScore: 44.25,
value: 60
}, {
name: 'Kyle',
score: 150,
avgScore: 50,
value: 60
}, {
name: 'Jordan',
score: 148,
avgScore: 24.67,
value: 80
}, {
name: 'Jack',
score: 138,
avgScore: 34.5,
value: 60
}, {
name: 'Kuldeep',
score: 130,
avgScore: 32.5,
value: 60
}, {
name: 'Max',
score: 128,
avgScore: 32,
value: 60
}, {
name: 'Angus',
score: 127,
avgScore: 62.5,
value: 60
}];
chart.changeData(res);
});
请问如何解决呢?
The text was updated successfully, but these errors were encountered: