fix: CSAT chart showing incorrect data (#7152)

* fix: computation of data for csat chart

* fix: make horizontal chart reactive
This commit is contained in:
Shivam Mishra
2023-05-22 11:01:01 +05:30
committed by GitHub
parent e8f56d0e56
commit d6ce1ceeeb
2 changed files with 10 additions and 2 deletions

View File

@@ -45,6 +45,14 @@ export default {
default: () => {},
},
},
watch: {
collection() {
this.renderChart(this.collection, {
...chartOptions,
...this.chartOptions,
});
},
},
mounted() {
this.renderChart(this.collection, {
...chartOptions,

View File

@@ -60,9 +60,9 @@ export default {
chartData() {
return {
labels: ['Rating'],
datasets: CSAT_RATINGS.map((rating, index) => ({
datasets: CSAT_RATINGS.map(rating => ({
label: rating.emoji,
data: [this.ratingPercentage[index + 1]],
data: [this.ratingPercentage[rating.value]],
backgroundColor: rating.color,
})),
};