Skip to content

Conversation

@Lighnat0r
Copy link
Contributor

This ensures that data points can be correctly located even if the time scale uses a custom parser.

@etimberg
Copy link
Member

+1 to merge

@etimberg etimberg merged commit b33aff2 into chartjs:master Aug 22, 2016
if (!value || !value.isValid) {
// not already a moment object
value = moment(me.getRightValue(value));
value = me.parseTime(me.getRightValue(value));

Choose a reason for hiding this comment

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

...ya know, you could have just used this here... ;)

Copy link
Member

Choose a reason for hiding this comment

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

this would work, but this cannot be minified. Since this would be used in a bunch of places, we do var me = this so that me can be minified in the function. In a single function this doesn't save much, but over the entire lib it saves a few kB.

Copy link
Member

Choose a reason for hiding this comment

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

If I did my maths correctly, it currently saves 4KB (~3%) on the minified version.

Choose a reason for hiding this comment

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

...learn something new... ;)

exwm pushed a commit to exwm/Chart.js that referenced this pull request Apr 30, 2021
Use parser options in getPixelForValue for time scale
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.

4 participants