_fullLoop: _loop
}) : null;
}
+
+export function _shouldApplyFill(source) {
+ return source && source.fill !== false;
+}
import LineElement from '../../elements/element.line';
import {_drawfill} from './filler.drawing';
+import {_shouldApplyFill} from './filler.helper';
import {_decodeFill, _resolveTarget} from './filler.options';
export default {
}
source.line.updateControlPoints(area, source.axis);
- if (draw) {
+ if (draw && source.fill) {
_drawfill(chart.ctx, source, area);
}
}
if (options.drawTime !== 'beforeDatasetsDraw') {
return;
}
+
const metasets = chart.getSortedVisibleDatasetMetas();
for (let i = metasets.length - 1; i >= 0; --i) {
const source = metasets[i].$filler;
- if (source) {
+
+ if (_shouldApplyFill(source)) {
_drawfill(chart.ctx, source, chart.chartArea);
}
}
beforeDatasetDraw(chart, args, options) {
const source = args.meta.$filler;
- if (!source || source.fill === false || options.drawTime !== 'beforeDatasetDraw') {
+ if (!_shouldApplyFill(source) || options.drawTime !== 'beforeDatasetDraw') {
return;
}
--- /dev/null
+module.exports = {
+ config: {
+ type: 'line',
+ data: {
+ labels: ['0', '1', '2', '3', '4', '5'],
+ datasets: [{
+ backgroundColor: 'red',
+ data: [3, -3, 0, 5, -5, 0],
+ fill: false
+ }]
+ },
+ options: {
+ plugins: {
+ legend: false,
+ title: false,
+ filler: {
+ drawTime: 'beforeDatasetDraw'
+ }
+ },
+ }
+ },
+};
--- /dev/null
+module.exports = {
+ config: {
+ type: 'line',
+ data: {
+ labels: ['0', '1', '2', '3', '4', '5'],
+ datasets: [{
+ backgroundColor: 'red',
+ data: [3, -3, 0, 5, -5, 0],
+ fill: false
+ }]
+ },
+ options: {
+ plugins: {
+ legend: false,
+ title: false,
+ filler: {
+ drawTime: 'beforeDatasetsDraw'
+ }
+ },
+ }
+ },
+};
--- /dev/null
+module.exports = {
+ config: {
+ type: 'line',
+ data: {
+ labels: ['0', '1', '2', '3', '4', '5'],
+ datasets: [{
+ backgroundColor: 'red',
+ data: [3, -3, 0, 5, -5, 0],
+ fill: false
+ }]
+ },
+ options: {
+ plugins: {
+ legend: false,
+ title: false,
+ filler: {
+ drawTime: 'beforeDraw'
+ }
+ },
+ }
+ },
+};