当在2个线序列之间填充颜色时,填充颜色与点重叠。
https://codesandbox.io/s/react-chartjs-2-line-chart-example-forked-5ruj86我在版本3.6.0中遇到此问题。
v7pvogib1#
只需将order属性添加到第一个数据集即可。文档
order
const data = { labels: ["Jan", "Feb", "Mar", "Apr", "May", "Jun"], datasets: [ { data: [1000000, 900000, 800000, 750000, 700000, 650000, 600000], color: "#008484", backgroundColor: "#A5E1D2", pointBorderColor: "#007B5E", pointBackgroundColor: "#ffffff", borderColor: "#008484", fill: 1, borderWidth: 3, pointRadius: 5, pointHoverRadius: 5, pointBorderRadius: 5, order: 1 }, { data: [800000, 700000, 600000, 550000, 500000, 450000, 400000], color: "#002E2E", backgroundColor: "#A5E1D2", pointBorderColor: "#002E2E", pointBackgroundColor: "#ffffff", borderColor: "#002E2E", fill: 1, borderWidth: 3, pointRadius: 5, pointHoverRadius: 5, pointBorderRadius: 5 } ] };
checkout codesandbox
1条答案
按热度按时间v7pvogib1#
只需将
order
属性添加到第一个数据集即可。文档checkout codesandbox