Skip to content

Commit 783be84

Browse files
committed
chore(ec-payment-methods-chart): minor tooltips and layout improves
1 parent 1fdfccd commit 783be84

File tree

2 files changed

+13
-11
lines changed

2 files changed

+13
-11
lines changed

src/components/cards/EcPaymentMethodsChart.vue

Lines changed: 8 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -1,20 +1,17 @@
11
<template>
2-
<div class="ec-payment-methods-graph">
3-
<div
4-
class="mx-auto mb-5"
5-
style="max-width: 350px"
6-
>
2+
<div
3+
class="ec-payment-methods-chart mx-auto"
4+
style="max-width: 500px"
5+
>
6+
<div class="mb-5">
77
<canvas
88
ref="canva-pie"
9-
width="350"
10-
height="350"
9+
width="400"
10+
height="300"
1111
></canvas>
1212
</div>
1313

14-
<div
15-
class="mx-auto"
16-
style="max-width: 500px"
17-
>
14+
<div>
1815
<canvas
1916
ref="canva-bar"
2017
width="400"

src/components/cards/js/EcPaymentMethodsChart.js

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -103,6 +103,11 @@ export default {
103103
}
104104
}]
105105
}
106+
} else {
107+
options.tooltips.callbacks.beforeLabel = ({ index }) => {
108+
const { _id } = aggregation[index]
109+
return i19PaymentMethodCodes[_id]
110+
}
106111
}
107112
aggregation = aggregation.sort((a, b) => a.color > b.color ? 1 : -1)
108113
return new Chart(this.$refs[ref], {

0 commit comments

Comments
 (0)