Skip to content

fix(time): bar bandWidth with time axis #11145#11479

Merged
Ovilia merged 5 commits intomasterfrom
fix-11145
Oct 28, 2019
Merged

fix(time): bar bandWidth with time axis #11145#11479
Ovilia merged 5 commits intomasterfrom
fix-11145

Conversation

@Ovilia
Copy link
Copy Markdown
Contributor

@Ovilia Ovilia commented Oct 24, 2019

fix(time): bar bandWidth with time axis #11145

before fixing (see bar2.html):
image

after fixing:
image

Bandwidth is calculated using the min gap between two adjacent time values of all series.

There's a bug with data filtering as reported in #11478, which is not raised in this pull request and can be reproduced with v4.4.0.

// Ignore 0 delta because they are of the same axis value
var delta = axisValues[i][j] - axisValues[i][j - 1];
delta = delta === 0 ? Number.MAX_VALUE : delta;
min = Math.min(min, delta);
Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I suggested changing these two lines to

if (delta > 0) {
  min = Math.min(min, delta)
}

to make it more clear and effecient.

@pissang
Copy link
Copy Markdown
Contributor

pissang commented Oct 28, 2019

LGTM now

@Ovilia Ovilia merged commit 794bad3 into master Oct 28, 2019
@Ovilia Ovilia deleted the fix-11145 branch October 28, 2019 12:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants