This commit is contained in:
2022-03-01 23:29:06 +00:00
parent fee9961785
commit d50a44d30a
4 changed files with 31 additions and 52 deletions

View File

@@ -77,13 +77,6 @@
v-model="localSettings.customTitle"
:label="$ay.t('Name')"
></v-text-field>
<v-color-picker
v-model="localSettings.color"
hide-mode-switch
hide-inputs
mode="hexa"
></v-color-picker>
</v-card-text>
<v-divider></v-divider>
@@ -118,6 +111,7 @@ export default {
data() {
return {
obj: {},
meta: [],
visible: true,
context: false,
localSettings: {},
@@ -128,7 +122,6 @@ export default {
chartOptions: {
responsive: true,
maintainAspectRatio: false,
// legend: { display: false },
scales: {
xAxes: [
{
@@ -157,19 +150,25 @@ export default {
},
computed: {
chartData() {
return {
datasets: [
{
label: "UserNameHere",
borderColor: this.settings.color ?? "#000000",
let ret = [];
this.meta.forEach(m => {
let userData = this.obj.filter(d => d.z == m.userid);
if (userData.length > 0) {
ret.push({
label: m.name,
borderColor: m.uicolor,
fill: false,
pointRadius: 2,
pointHoverRadius: 6,
pointHitRadius: 3,
data: this.obj
}
]
};
data: userData.map(d => {
return { x: d.x, y: d.y };
})
});
}
});
//console.log(JSON.stringify({ datasets: ret }));
return { datasets: ret };
}
},
async created() {
@@ -225,6 +224,7 @@ export default {
timeZone: this.timeZoneName
});
});
this.meta = res.meta;
this.obj = res.data;
}
} catch (error) {