-
Notifications
You must be signed in to change notification settings - Fork 11.9k
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
Ensure deprecated unitStepSize property of time scale is respected #4401
Conversation
test/specs/scale.time.tests.js
Outdated
expect(ticks).toEqual(['8PM', '10PM']); | ||
}); | ||
|
||
it('should use the stepSize property', function() { |
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.
I would move the deprecated option in core.deprecations.test.js
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.
Ok, will do.
} | ||
|
||
it('should use the stepSize property', function() { | ||
var mockData = { |
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.
Could we simply acquire a chart with minimal options and remove the createScale
setup?
src/scales/scale.time.js
Outdated
@@ -146,7 +146,8 @@ module.exports = function(Chart) { | |||
me.unit = unit; | |||
me.majorUnit = majorUnit; | |||
|
|||
var stepSize = timeOpts.stepSize || timeHelpers.determineStepSize(minTimestamp || dataMin, maxTimestamp || dataMax, unit, maxTicks); | |||
var optionStepSize = helpers.getValueOrDefault(timeOpts.stepSize, timeOpts.unitStepSize); |
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.
helpers.valueOrDefault()
;)
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.
Will rebase and update
Also added tests
resolves #4391