antv中热力图中,坐标位置一样时,颜色如何叠加显示?
- Dominant language
- JavaScript
- Stars
- 8k
- Forks
- 637
- PR merge metrics
- No merged PRs in 30d
Description
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();
Contributor guide
Research direction
Reproduce the duplicate [0, 0] data through the shown F2 Chart, chart.source, and chart.polygon().color() entry points, then inspect the heatmap or polygon rendering path. Clarify whether coincident values should be aggregated or visually composited; completion requires a documented and tested behavior for duplicate coordinates.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- javascript
- Domain
- data-visualization
- Issue type
- Feature
- Difficulty
- 4/5
- Estimated time
- 3-5 days
- Activity status
- Stale
- Clarity
- Mostly clear
- Newbie friendliness
- 30/100