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

Ensure deprecated unitStepSize property of time scale is respected #4401

Merged
merged 1 commit into from
Jun 25, 2017

Conversation

etimberg
Copy link
Member

Also added tests

resolves #4391

@etimberg etimberg added this to the Version 2.7 milestone Jun 22, 2017
expect(ticks).toEqual(['8PM', '10PM']);
});

it('should use the stepSize property', function() {
Copy link
Member

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

Copy link
Member Author

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 = {
Copy link
Member

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?

@@ -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);
Copy link
Member

Choose a reason for hiding this comment

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

helpers.valueOrDefault() ;)

Copy link
Member Author

Choose a reason for hiding this comment

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

Will rebase and update

@simonbrunel simonbrunel merged commit 8834bab into master Jun 25, 2017
@simonbrunel simonbrunel deleted the fix/4391 branch June 25, 2017 12:37
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.

2.6.0 Line Chart xAxis Type Time ignores unitStepSize
2 participants