fix: make legend disappear by not declaring plugins twice

This commit is contained in:
Cindy Chang
2024-06-19 10:21:15 +08:00
parent 80529b85fe
commit b10e135fee
3 changed files with 9 additions and 19 deletions

View File

@@ -835,6 +835,9 @@ export default {
title: function(context) {
return `${content.x}: ${getMoment(context[0].parsed.x)}`;
},
label:function(context) {
return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
},
},
},
title: {
@@ -908,15 +911,6 @@ export default {
}
},
},
plugins: {
tooltip: {
callbacks:{
label:function(context) {
return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
},
},
},
},
};
return [primeVueSetData, primeVueSetOption];

View File

@@ -814,6 +814,11 @@ export default {
title: function(context) {
return `${content.x}: ${getMoment(context[0].parsed.x)}`;
}
//TODO: Not sure which one to apply. callbacks:{
// label:function(context) {
// return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
// },
// },
},
},
title: {
@@ -888,15 +893,6 @@ export default {
}
},
},
plugins: {
tooltip: {
callbacks:{
label:function(context) {
return `${content.y}: ${getSimpleTimeLabel(context.parsed.y, 2)}`;
},
},
},
},
};
return [primeVueSetData, primeVueSetOption]