fix weaponchart responsive position

This commit is contained in:
2023-03-30 12:07:15 +02:00
parent 6ee0fff6bf
commit bbb7dd47bb
+7 -6
View File
@@ -86,23 +86,23 @@ export default defineComponent({
// eslint-disable-next-line no-unused-expressions // eslint-disable-next-line no-unused-expressions
this.$props.playerHighlighted this.$props.playerHighlighted
const options = { const options = {
responsive: false, responsive: true,
maintainAspectRatio: true, maintainAspectRatio: true,
animation: { duration: 500 }, animation: { duration: 500 },
layout: { autoPadding: false }, layout: { autoPadding: false },
plugins: { plugins: {
datalabels: { datalabels: {
formatter: (value:any, context:any) => { formatter: (value: any, context: any) => {
return this.sortedWeaponList[context.dataIndex] return this.sortedWeaponList[context.dataIndex]
}, },
backgroundColor: (context:any) => { backgroundColor: (context: any) => {
return context.dataset.backgroundColor(context) return context.dataset.backgroundColor(context)
}, },
borderColor: this.colors.fg, borderColor: this.colors.fg,
borderRadius: 25, borderRadius: 25,
borderWidth: 2, borderWidth: 2,
color: this.colors.bg, color: this.colors.bg,
display: (context:any) => { display: (context: any) => {
return context.dataIndex === context.dataset.labels.length - 1 ? true : 'auto' return context.dataIndex === context.dataset.labels.length - 1 ? true : 'auto'
}, },
font: { font: {
@@ -158,8 +158,9 @@ export default defineComponent({
</script> </script>
<style scoped> <style scoped>
canvas { .weaponChart {
background: var(--accent); width: calc(min(50vw, 50vh) - 3em);
height: calc(min(50vw, 50vh) - 3em);
} }
@media only screen and (max-width: 922px) { @media only screen and (max-width: 922px) {