fix: Fixes tooltip data inconsistency in heatmap
Removes unnecessary 'value' key in chart data config Updates tooltip to correctly display 'Mood Count' using 'extract_data' object for improved accuracy
This commit is contained in:
parent
68009c0865
commit
54be38232f
1 changed files with 1 additions and 2 deletions
|
@ -28,7 +28,6 @@ fetch("/mood/statistics/heatmap/values/")
|
||||||
}
|
}
|
||||||
return 0;
|
return 0;
|
||||||
},
|
},
|
||||||
value: "count",
|
|
||||||
},
|
},
|
||||||
scale: {
|
scale: {
|
||||||
color: {
|
color: {
|
||||||
|
@ -77,7 +76,7 @@ fetch("/mood/statistics/heatmap/values/")
|
||||||
const key = Object.keys(moodOptions).reduce((a, b) => Math.abs(moodOptions[a] - average) < Math.abs(moodOptions[b] - average) ? a : b);
|
const key = Object.keys(moodOptions).reduce((a, b) => Math.abs(moodOptions[a] - average) < Math.abs(moodOptions[b] - average) ? a : b);
|
||||||
const mood = moodOptions[key];
|
const mood = moodOptions[key];
|
||||||
|
|
||||||
return `${date_str}<br>Mood Count: ${value}<br>Average Mood: ${mood.name}`
|
return `${date_str}<br>Mood Count: ${obj.count}<br>Average Mood: ${mood.name}`
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
]
|
]
|
||||||
|
|
Loading…
Reference in a new issue