-
Notifications
You must be signed in to change notification settings - Fork 605
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
Added support for stepPlot per-series #204
Added support for stepPlot per-series #204
Conversation
@@ -261,7 +261,12 @@ DygraphCanvasRenderer._drawStyledLine = function(e, | |||
drawPointCallback, pointSize) { | |||
var g = e.dygraph; | |||
// TODO(konigsberg): Compute attributes outside this method call. | |||
var stepPlot = g.getOption("stepPlot"); // TODO(danvk): per-series | |||
var stepPlot = g.getOption("stepPlot"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Try g.attributes_.getForSeries("stepPlot", e.setName);
We don't want private things to leak outside Dygraphs, and we really shouldn't let them leak from object to object either, but for now we're letting g.attributes_ leak outside. (Dan, is that OK here?)
Please see http://dygraphs.com/changes.html, which describes lint and testing. (I have to update the testing doc since there are easier ways to run tests now.)
Thank you kberg for the comment, sorry that the diff you commented is now outdated, I messed up a push, that lead to the need of rewriting the history of the pull-request. Really sorry for this. ;) We changed the indentation in respect to jslint, and fixed the code a little, but we don't understand about the proposal to use Also we figured out that passing the seriesName directly will do what we intend since getOption will return the global value if none is defined for the given series. (see dygraph.js line 563 - 566) |
Please add either a test or an example of this being used. You can read about testing procedures at dygraphs.com/changes.html. At the very least, please add an example of a chart with both a stepPlot series and a non-stepPlot series to tests/steps.html. |
stackedGraph and fillGraph options
Thanks for the feedback. |
document.body.innerHTML = "<div id='graph'></div>"; | ||
}; | ||
|
||
var _origFunc = Dygraph.getContext; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This is a global variable which might conflict with others. I suggest you use stepTestCase.origFunc
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We have based this behavior on the following tests:
custom_bars.js
error_bars.js
missing_points.js
simple_drawing.js
to_dom_coords.js
which all use the same global variable. We're not sure what to do now since the same would apply to all of these tests. Any idea?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Take care of yours, and I'll fix it for all the others.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Also note that the standard is to have the test case name capitalized. Can you tweak that too, please?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
You know what? Don't worry about the test name. There are enough that are different. Maybe I'll go fix them historically, but no big deal.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We will change the test name and also change the file name to lower case. We will also adapt the global var for the orginal getContext function for our text. thx
When I run this locally I get two test failures when I run ./test.sh 2 test(s) failed: and get the following when running on OSX/Chrome Running testMixedModeStepAndLineStackedAndFilled fake-jstestdriver.js:101 assertLineDrawn can be pretty tricky. Are the tests passing for you? |
Yes we have tried to run the test multiple times on our Win7/Chrome and they all passed flawlessly. We have now rerun them and also get the 2 failures. This must be due to the merge we did with your latest commits. However we have no idea what might have caused the suddon failure. We will investigate the problem and try to fix it. sorry for causing all these problems |
No need to apologize. You're helping us! But I'm glad you're getting the same failures. That's better than you still having the tests pass. :) |
file to lower case
The tests are fixed and the test name is now adapted as well as the variable "origFunc". |
I have confirmed that the tests pass. Dan? |
Looks great. I'm pulling this now, thanks for the change! |
…c466de7733 Added support for stepPlot per-series
Hello,
we (Sauter) have decided to work with dygraphs for one of our products because it really seems to be a good soltution!
We saw your to do and added the feature enabling series based definition of the step plot functionality.
Best regards