reduction job, chart duplicates
continuous-integration/drone/push Build is passing

This commit is contained in:
2020-08-25 15:24:20 +02:00
parent 19904bd0ec
commit f57444a3d1
11 changed files with 185 additions and 29 deletions
+20 -3
View File
@@ -17,6 +17,10 @@ export default {
yaxis: {
type: Array,
required: true
},
remove_duplicates: {
type: Boolean,
default: false
}
},
computed: {
@@ -28,10 +32,23 @@ export default {
data: [],
yAxisID: index,
borderColor: y.color,
backgroundColor: y.fill
backgroundColor: y.fill,
spanGaps: true
};
for (const data of this.data)
res.data.push (resolve_data (data, y.field));
let last = null;
for (let i = 0; i < this.data.length; i++) {
const data = this.data[i];
const val = resolve_data (data, y.field);
if (
!this.remove_duplicates
|| last !== val
|| this.data.length - 1 === i
)
res.data.push (val);
else
res.data.push (null);
last = val;
}
return res;
});
return { datasets, labels };