This commit is contained in:
Sara Arjona
2025-03-10 11:12:05 +01:00
3 changed files with 5 additions and 3 deletions
File diff suppressed because one or more lines are too long
File diff suppressed because one or more lines are too long
+3 -1
View File
@@ -200,6 +200,7 @@ define([
datasets: this._makeDatasetsConfig()
},
options: {
locale: document.documentElement.getAttribute('lang'),
responsive: true,
maintainAspectRatio: false,
plugins: {
@@ -307,10 +308,11 @@ define([
Output.prototype._makeTooltip = function(tooltipItem) {
// Get series and chart data to rebuild the tooltip and add labels.
const formatter = new Intl.NumberFormat(this._config.options.locale);
var series = this._chart.getSeries()[tooltipItem.datasetIndex];
var serieLabel = series.getLabel();
var chartData = tooltipItem.dataset.data;
var tooltipData = chartData[tooltipItem.dataIndex];
var tooltipData = formatter.format(chartData[tooltipItem.dataIndex]);
// Build default tooltip.
var tooltip = [];