Skip to content

Commit

Permalink
Stop unnecessary line calculations (#6671)
Browse files Browse the repository at this point in the history
  • Loading branch information
benmccann authored and etimberg committed Nov 2, 2019
1 parent 1cce8a5 commit a985fec
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/controllers/controller.line.js
Original file line number Diff line number Diff line change
Expand Up @@ -229,12 +229,13 @@ module.exports = DatasetController.extend({
var yScale = me._yScale;
var sumPos = 0;
var sumNeg = 0;
var rightValue = +yScale.getRightValue(value);
var metasets = chart._getSortedVisibleDatasetMetas();
var ilen = metasets.length;
var i, ds, dsMeta, stackedRightValue;
var i, ds, dsMeta, stackedRightValue, rightValue, metasets, ilen;

if (yScale.options.stacked) {
rightValue = +yScale.getRightValue(value);
metasets = chart._getSortedVisibleDatasetMetas();
ilen = metasets.length;

for (i = 0; i < ilen; ++i) {
dsMeta = metasets[i];
if (dsMeta.index === datasetIndex) {
Expand Down

0 comments on commit a985fec

Please sign in to comment.