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

antv中热力图中,坐标位置一样时,颜色如何叠加显示? #866

Open
huangshun1 opened this issue May 9, 2020 · 1 comment

Comments

@huangshun1
Copy link

import F2 from '@antv/f2';

const data = [
[ 0, 0, 10 ],
[ 0, 0, 19 ],

此处坐标一直,但是在图表中只能显示最后的颜色,怎么才能将两种颜色叠加
];
const source = [];
for (let i = 0; i < data.length; i++) {
const item = data[i];
const obj = {};
obj.name = item[0];
obj.day = item[1];
obj.sales = item[2];
source.push(obj);
}
const chart = new F2.Chart({
id: 'container',
pixelRatio: window.devicePixelRatio
});
chart.source(source, {
name: {
type: 'cat',
values: [ 'A', 'B', 'C', 'D', 'E', 'F', 'G', 'H', 'I', 'J' ]
},
day: {
type: 'cat',
values: [ 'Mon.', 'Tue.', 'Wed.', 'Thu.', 'Fri.' ]
}
});

chart.polygon()
.position('name*day')
.color('sales', '#BAE7FF-#1890FF-#0050B3')
.style({
lineWidth: 1,
stroke: '#fff'
})
.animate({
appear: {
animation: 'fadeIn',
duration: 800
}
});
chart.render();

@cycgit
Copy link
Contributor

cycgit commented Aug 18, 2020

https://stackblitz.com/edit/react-8wai9s?file=index.js 构建一个demo看看

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants