Skip to content

Commit

Permalink
Return correct label for value type axis
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Dec 16, 2018
1 parent b3d3df4 commit b4e4203
Showing 1 changed file with 7 additions and 2 deletions.
9 changes: 7 additions & 2 deletions src/scales/scale.category.js
Expand Up @@ -53,10 +53,15 @@ module.exports = function() {

getLabelForIndex: function(index, datasetIndex) {
var me = this;
var data = me.chart.data;
var chart = me.chart;
var data = chart.data;
var isHorizontal = me.isHorizontal();
var ds = chart.getDatasetMeta(datasetIndex).controller;
var isValue = typeof ds.getValueScaleId === 'function'
? ds.getValueScaleId() === me.id
: null;

if (data.yLabels && !isHorizontal) {
if (isValue || (isValue === null && !isHorizontal)) {
return me.getRightValue(data.datasets[datasetIndex].data[index]);
}
return me.ticks[index - me.minIndex];
Expand Down

0 comments on commit b4e4203

Please sign in to comment.