Skip to content

Commit

Permalink
Merge branch 'MDL-59790-master' of git://github.com/lameze/moodle
Browse files Browse the repository at this point in the history
  • Loading branch information
stronk7 committed Aug 23, 2017
2 parents fc7467e + b45ca55 commit 8839739
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 3 deletions.
2 changes: 1 addition & 1 deletion lib/amd/build/chart_output_chartjs.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

12 changes: 10 additions & 2 deletions lib/amd/src/chart_output_chartjs.js
Expand Up @@ -293,11 +293,19 @@ define([
var tooltipData = chartData[tooltipItem.index];

// Build default tooltip.
var tooltip = this._cleanData(serieLabel) + ': ' + tooltipData;
var tooltip = [];

// Pie and doughnut charts does not have axis.
if (tooltipItem.xLabel == '' && tooltipItem.yLabel == '') {
var chartLabels = this._cleanData(this._chart.getLabels());
tooltip.push(chartLabels[tooltipItem.index]);
}

// Add series labels to the tooltip if any.
if (serieLabels !== null) {
tooltip = this._cleanData(serieLabels[tooltipItem.index]);
tooltip.push(this._cleanData(serieLabels[tooltipItem.index]));
} else {
tooltip.push(this._cleanData(serieLabel) + ': ' + tooltipData);
}

return tooltip;
Expand Down

0 comments on commit 8839739

Please sign in to comment.