mirror of
https://github.com/chartjs/Chart.js.git
synced 2026-03-23 16:46:53 +01:00
Fix filling between datasets of different lengths
This commit is contained in:
committed by
Evert Timberg
parent
9e6a6112a4
commit
5e58114848
@@ -19,9 +19,10 @@ module.exports = function(Chart) {
|
||||
var meta = chart.getDatasetMeta(index);
|
||||
var visible = meta && chart.isDatasetVisible(index);
|
||||
var points = (visible && meta.dataset._children) || [];
|
||||
var length = points.length || 0;
|
||||
|
||||
return !points.length? null : function(point, i) {
|
||||
return points[i]._view || null;
|
||||
return !length? null : function(point, i) {
|
||||
return (i < length && points[i]._view) || null;
|
||||
};
|
||||
},
|
||||
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"fill": "+1"
|
||||
}, {
|
||||
"backgroundColor": "rgba(0, 0, 255, 0.25)",
|
||||
"data": [0, 2, 0, -2, 0, 2, 0, null, null],
|
||||
"data": [0, 2, 0, -2, 0, 2, 0],
|
||||
"fill": 3
|
||||
}, {
|
||||
"backgroundColor": "rgba(255, 0, 255, 0.25)",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"fill": "+1"
|
||||
}, {
|
||||
"backgroundColor": "rgba(0, 0, 255, 0.25)",
|
||||
"data": [0, 2, 0, -2, 0, 2, 0, null, null],
|
||||
"data": [0, 2, 0, -2, 0, 2, 0],
|
||||
"fill": 3
|
||||
}, {
|
||||
"backgroundColor": "rgba(255, 0, 255, 0.25)",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"fill": "+1"
|
||||
}, {
|
||||
"backgroundColor": "rgba(0, 0, 255, 0.25)",
|
||||
"data": [0, 2, 0, -2, 0, 2, 0, null, null],
|
||||
"data": [0, 2, 0, -2, 0, 2, 0],
|
||||
"fill": 3
|
||||
}, {
|
||||
"backgroundColor": "rgba(255, 0, 255, 0.25)",
|
||||
|
||||
@@ -13,7 +13,7 @@
|
||||
"fill": "+1"
|
||||
}, {
|
||||
"backgroundColor": "rgba(0, 0, 255, 0.25)",
|
||||
"data": [0, 2, 0, -2, 0, 2, 0, null, null],
|
||||
"data": [0, 2, 0, -2, 0, 2, 0],
|
||||
"fill": 3
|
||||
}, {
|
||||
"backgroundColor": "rgba(255, 0, 255, 0.25)",
|
||||
|
||||
Reference in New Issue
Block a user