Skip to content

Commit

Permalink
suggested changes
Browse files Browse the repository at this point in the history
  • Loading branch information
kurkle committed Dec 21, 2018
1 parent eb749c1 commit 3fcc72e
Showing 1 changed file with 4 additions and 3 deletions.
7 changes: 4 additions & 3 deletions src/scales/scale.category.js
Expand Up @@ -62,12 +62,13 @@ module.exports = function() {
var ds = chart.getDatasetMeta && chart.getDatasetMeta(datasetIndex).controller;

// Do we have a getValuesScaleId function? (eg. bar chart)
var hasValueScale = ds && ds.getValueScaleId;
var isValueScale = hasValueScale && ds.getValueScaleId() === me.id;
var isValueScale = ds && ds.getValueScaleId
? ds.getValueScaleId() === me.id
: !isHorizontal;

// FIXME For non-bar charts we assume vertical axis is a value scale
// and thus should return getRightValue
if (isValueScale || (!hasValueScale && !isHorizontal)) {
if (isValueScale) {
return me.getRightValue(data.datasets[datasetIndex].data[index]);
}
return me.ticks[index - me.minIndex];
Expand Down

0 comments on commit 3fcc72e

Please sign in to comment.