From: Jukka Kurkela Date: Thu, 18 Apr 2019 20:39:52 +0000 (+0300) Subject: Fix missing tooltip value in radar charts (#6209) X-Git-Tag: v2.9.0~1^2~78 X-Git-Url: http://git.ipfire.org/?a=commitdiff_plain;h=89af7b1383fffd477e0f6245770920e36450ac58;p=thirdparty%2FChart.js.git Fix missing tooltip value in radar charts (#6209) --- diff --git a/src/controllers/controller.radar.js b/src/controllers/controller.radar.js index 770ddc51a..20383c677 100644 --- a/src/controllers/controller.radar.js +++ b/src/controllers/controller.radar.js @@ -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, diff --git a/test/specs/controller.radar.tests.js b/test/specs/controller.radar.tests.js index 6b2c75454..b9a233d12 100644 --- a/test/specs/controller.radar.tests.js +++ b/test/specs/controller.radar.tests.js @@ -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'); + }); });