Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

LogScale and customBars with negative values #250

Merged
merged 5 commits into from
Jun 6, 2013
Merged

LogScale and customBars with negative values #250

merged 5 commits into from
Jun 6, 2013

Conversation

wimme
Copy link
Contributor

@wimme wimme commented May 31, 2013

When LogScale and customBars are enabled, it was verifying if the value was negative by using a <= on an array and then inserting a null. This caused exceptions in rollingAverage(), the value can't be null when using customBars.

(This a new patch based on the current code, since pull request #236 was getting old).

When LogScale and customBars are enabled, it was verifying if the value was negative by using a <= on an array and then inserting a null. This caused exceptions in rollingAverage(), the value can't be null when using customBars.

(This a new patch based on the current code, since pull request #236 was getting old).
@@ -2821,12 +2821,20 @@ Dygraph.prototype.extractSeries_ = function(rawData, i, logScale) {
if (logScale) {
// On the log scale, points less than zero do not exist.
// This will create a gap in the chart.
if (point <= 0) {
if (errorBars || customBars) {
for (var k = 0; k < point.length; k++) {
Copy link
Owner

Choose a reason for hiding this comment

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

Add a comment here:
// point.length is either 2 (errorBars) or 3 (customBars)

I was initially confused because I read this as a loop over all the points, rather than the elements of a single point.

@kberg
Copy link
Collaborator

kberg commented May 31, 2013

For some reason I can't leave comments within the code. Please just put the else on the same line as the closing brace.

e.g.

if (cond) {
}
else {
}

should be

if (cond) {
} else {
}

@kberg
Copy link
Collaborator

kberg commented Jun 6, 2013

Alright, this looks acceptable and is small enough that Klaus and I should be able to make this work. Thanks, @wimme and sorry for the delay.

kberg added a commit that referenced this pull request Jun 6, 2013
LogScale and customBars with negative values
@kberg kberg merged commit ba57e1b into danvk:master Jun 6, 2013
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants