Skip to content

Commit

Permalink
Fix missing tooltip value in radar charts (chartjs#6209)
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle authored and simonbrunel committed Apr 18, 2019
1 parent 40cdd98 commit e68a16b
Show file tree
Hide file tree
Showing 2 changed files with 33 additions and 0 deletions.
13 changes: 13 additions & 0 deletions src/controllers/controller.radar.js
Expand Up @@ -20,6 +20,19 @@ defaults._set('radar', {
});

module.exports = DatasetController.extend({
/**
* @private
*/
_getValueScaleId: function() {
return this.chart.scale.id;
},

/**
* @private
*/
_getIndexScaleId: function() {
return this.chart.scale.id;
},

datasetElementType: elements.Line,

Expand Down
20 changes: 20 additions & 0 deletions test/specs/controller.radar.tests.js
Expand Up @@ -443,4 +443,24 @@ describe('Chart.controllers.radar', function() {
expect(meta0.data[0]._model.radius).toBe(10);
expect(meta1.data[0]._model.radius).toBe(20);
});

it('should return same id for index and value scale', function() {
var chart = window.acquireChart({
type: 'radar',
data: {
datasets: [{
data: [10, 15, 0, 4],
pointBorderWidth: 0
}],
labels: ['label1', 'label2', 'label3', 'label4']
},
options: {
scale: {id: 'test'}
}
});

var controller = chart.getDatasetMeta(0).controller;
expect(controller._getIndexScaleId()).toBe('test');
expect(controller._getValueScaleId()).toBe('test');
});
});

0 comments on commit e68a16b

Please sign in to comment.