{"action":"created","comment":{"url":"https://api.github.com/repos/nnnick/Chart.js/pulls/comments/52013170","id":52013170,"diff_hunk":"@@ -169,16 +170,24 @@\n \t\t\t\tthis.max++;\n \t\t\t}\n \n-\t\t\tvar niceRange = helpers.niceNum(this.max - this.min, false);\n-\t\t\tvar spacing = helpers.niceNum(niceRange / (maxTicks - 1), true);\n-\t\t\tvar niceMin = Math.floor(this.min / spacing) * spacing;\n-\t\t\tvar niceMax = Math.ceil(this.max / spacing) * spacing;\n+\t\t\tif (this.options.ticks.fixedStepSize && this.options.ticks.fixedStepSize > 0) {\n+\t\t\t\tvar j = this.min;\n+\t\t\t\twhile (j <= this.max) {","path":"src/scales/scale.linear.js","position":32,"original_position":32,"commit_id":"92bc1a04cf8b08d5b61459ac09d799659f2b359d","original_commit_id":"92bc1a04cf8b08d5b61459ac09d799659f2b359d","user":{"login":"etimberg","id":6757853,"avatar_url":"https://avatars.githubusercontent.com/u/6757853?v=3","gravatar_id":"","url":"https://api.github.com/users/etimberg","html_url":"https://github.com/etimberg","followers_url":"https://api.github.com/users/etimberg/followers","following_url":"https://api.github.com/users/etimberg/following{/other_user}","gists_url":"https://api.github.com/users/etimberg/gists{/gist_id}","starred_url":"https://api.github.com/users/etimberg/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/etimberg/subscriptions","organizations_url":"https://api.github.com/users/etimberg/orgs","repos_url":"https://api.github.com/users/etimberg/repos","events_url":"https://api.github.com/users/etimberg/events{/privacy}","received_events_url":"https://api.github.com/users/etimberg/received_events","type":"User","site_admin":false},"body":"It is probably safer to exit the loop when you've added enough spaces rather than when j > max. The reason is that for very small numbers this may fail.\r\n\r\nWhat about setting `numSpaces = this.options.ticks.fixedStepSize` and then setting `spacing = (this.max - this.min) / numSpaces`. That way you can reuse the loop that's in the else block for both cases. ","created_at":"2016-02-05T13:07:53Z","updated_at":"2016-02-05T13:07:53Z","html_url":"https://github.com/nnnick/Chart.js/pull/1978#discussion_r52013170","pull_request_url":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978","_links":{"self":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/comments/52013170"},"html":{"href":"https://github.com/nnnick/Chart.js/pull/1978#discussion_r52013170"},"pull_request":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978"}}},"pull_request":{"url":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978","id":58261750,"html_url":"https://github.com/nnnick/Chart.js/pull/1978","diff_url":"https://github.com/nnnick/Chart.js/pull/1978.diff","patch_url":"https://github.com/nnnick/Chart.js/pull/1978.patch","issue_url":"https://api.github.com/repos/nnnick/Chart.js/issues/1978","number":1978,"state":"open","locked":false,"title":"V2.0 dev","user":{"login":"roben","id":812205,"avatar_url":"https://avatars.githubusercontent.com/u/812205?v=3","gravatar_id":"","url":"https://api.github.com/users/roben","html_url":"https://github.com/roben","followers_url":"https://api.github.com/users/roben/followers","following_url":"https://api.github.com/users/roben/following{/other_user}","gists_url":"https://api.github.com/users/roben/gists{/gist_id}","starred_url":"https://api.github.com/users/roben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roben/subscriptions","organizations_url":"https://api.github.com/users/roben/orgs","repos_url":"https://api.github.com/users/roben/repos","events_url":"https://api.github.com/users/roben/events{/privacy}","received_events_url":"https://api.github.com/users/roben/received_events","type":"User","site_admin":false},"body":"I noticed that using the label callbacks only added all returned contents to a single line in contrast to the documentation: \"All functions must return either a string or an array of strings. Arrays of strings are treated as multiple lines of text.\". This pull request fixes this.","created_at":"2016-02-04T09:45:41Z","updated_at":"2016-02-05T13:07:53Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978/commits","review_comments_url":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978/comments","review_comment_url":"https://api.github.com/repos/nnnick/Chart.js/pulls/comments{/number}","comments_url":"https://api.github.com/repos/nnnick/Chart.js/issues/1978/comments","statuses_url":"https://api.github.com/repos/nnnick/Chart.js/statuses/92bc1a04cf8b08d5b61459ac09d799659f2b359d","head":{"label":"roben:v2.0-dev","ref":"v2.0-dev","sha":"92bc1a04cf8b08d5b61459ac09d799659f2b359d","user":{"login":"roben","id":812205,"avatar_url":"https://avatars.githubusercontent.com/u/812205?v=3","gravatar_id":"","url":"https://api.github.com/users/roben","html_url":"https://github.com/roben","followers_url":"https://api.github.com/users/roben/followers","following_url":"https://api.github.com/users/roben/following{/other_user}","gists_url":"https://api.github.com/users/roben/gists{/gist_id}","starred_url":"https://api.github.com/users/roben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roben/subscriptions","organizations_url":"https://api.github.com/users/roben/orgs","repos_url":"https://api.github.com/users/roben/repos","events_url":"https://api.github.com/users/roben/events{/privacy}","received_events_url":"https://api.github.com/users/roben/received_events","type":"User","site_admin":false},"repo":{"id":46985672,"name":"Chart.js","full_name":"roben/Chart.js","owner":{"login":"roben","id":812205,"avatar_url":"https://avatars.githubusercontent.com/u/812205?v=3","gravatar_id":"","url":"https://api.github.com/users/roben","html_url":"https://github.com/roben","followers_url":"https://api.github.com/users/roben/followers","following_url":"https://api.github.com/users/roben/following{/other_user}","gists_url":"https://api.github.com/users/roben/gists{/gist_id}","starred_url":"https://api.github.com/users/roben/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/roben/subscriptions","organizations_url":"https://api.github.com/users/roben/orgs","repos_url":"https://api.github.com/users/roben/repos","events_url":"https://api.github.com/users/roben/events{/privacy}","received_events_url":"https://api.github.com/users/roben/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/roben/Chart.js","description":"Simple HTML5 Charts using the <canvas> tag","fork":true,"url":"https://api.github.com/repos/roben/Chart.js","forks_url":"https://api.github.com/repos/roben/Chart.js/forks","keys_url":"https://api.github.com/repos/roben/Chart.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/roben/Chart.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/roben/Chart.js/teams","hooks_url":"https://api.github.com/repos/roben/Chart.js/hooks","issue_events_url":"https://api.github.com/repos/roben/Chart.js/issues/events{/number}","events_url":"https://api.github.com/repos/roben/Chart.js/events","assignees_url":"https://api.github.com/repos/roben/Chart.js/assignees{/user}","branches_url":"https://api.github.com/repos/roben/Chart.js/branches{/branch}","tags_url":"https://api.github.com/repos/roben/Chart.js/tags","blobs_url":"https://api.github.com/repos/roben/Chart.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/roben/Chart.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/roben/Chart.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/roben/Chart.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/roben/Chart.js/statuses/{sha}","languages_url":"https://api.github.com/repos/roben/Chart.js/languages","stargazers_url":"https://api.github.com/repos/roben/Chart.js/stargazers","contributors_url":"https://api.github.com/repos/roben/Chart.js/contributors","subscribers_url":"https://api.github.com/repos/roben/Chart.js/subscribers","subscription_url":"https://api.github.com/repos/roben/Chart.js/subscription","commits_url":"https://api.github.com/repos/roben/Chart.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/roben/Chart.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/roben/Chart.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/roben/Chart.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/roben/Chart.js/contents/{+path}","compare_url":"https://api.github.com/repos/roben/Chart.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/roben/Chart.js/merges","archive_url":"https://api.github.com/repos/roben/Chart.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/roben/Chart.js/downloads","issues_url":"https://api.github.com/repos/roben/Chart.js/issues{/number}","pulls_url":"https://api.github.com/repos/roben/Chart.js/pulls{/number}","milestones_url":"https://api.github.com/repos/roben/Chart.js/milestones{/number}","notifications_url":"https://api.github.com/repos/roben/Chart.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/roben/Chart.js/labels{/name}","releases_url":"https://api.github.com/repos/roben/Chart.js/releases{/id}","deployments_url":"https://api.github.com/repos/roben/Chart.js/deployments","created_at":"2015-11-27T14:56:41Z","updated_at":"2015-11-27T14:56:42Z","pushed_at":"2016-02-05T09:12:09Z","git_url":"git://github.com/roben/Chart.js.git","ssh_url":"git@github.com:roben/Chart.js.git","clone_url":"https://github.com/roben/Chart.js.git","svn_url":"https://github.com/roben/Chart.js","homepage":"http://www.chartjs.org/","size":2389,"stargazers_count":0,"watchers_count":0,"language":"JavaScript","has_issues":false,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"nnnick:v2.0-dev","ref":"v2.0-dev","sha":"73300e91c413da37c8310ce10c563b0eba018a3c","user":{"login":"nnnick","id":1458051,"avatar_url":"https://avatars.githubusercontent.com/u/1458051?v=3","gravatar_id":"","url":"https://api.github.com/users/nnnick","html_url":"https://github.com/nnnick","followers_url":"https://api.github.com/users/nnnick/followers","following_url":"https://api.github.com/users/nnnick/following{/other_user}","gists_url":"https://api.github.com/users/nnnick/gists{/gist_id}","starred_url":"https://api.github.com/users/nnnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnnick/subscriptions","organizations_url":"https://api.github.com/users/nnnick/orgs","repos_url":"https://api.github.com/users/nnnick/repos","events_url":"https://api.github.com/users/nnnick/events{/privacy}","received_events_url":"https://api.github.com/users/nnnick/received_events","type":"User","site_admin":false},"repo":{"id":8843683,"name":"Chart.js","full_name":"nnnick/Chart.js","owner":{"login":"nnnick","id":1458051,"avatar_url":"https://avatars.githubusercontent.com/u/1458051?v=3","gravatar_id":"","url":"https://api.github.com/users/nnnick","html_url":"https://github.com/nnnick","followers_url":"https://api.github.com/users/nnnick/followers","following_url":"https://api.github.com/users/nnnick/following{/other_user}","gists_url":"https://api.github.com/users/nnnick/gists{/gist_id}","starred_url":"https://api.github.com/users/nnnick/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nnnick/subscriptions","organizations_url":"https://api.github.com/users/nnnick/orgs","repos_url":"https://api.github.com/users/nnnick/repos","events_url":"https://api.github.com/users/nnnick/events{/privacy}","received_events_url":"https://api.github.com/users/nnnick/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nnnick/Chart.js","description":"Simple HTML5 Charts using the <canvas> tag","fork":false,"url":"https://api.github.com/repos/nnnick/Chart.js","forks_url":"https://api.github.com/repos/nnnick/Chart.js/forks","keys_url":"https://api.github.com/repos/nnnick/Chart.js/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nnnick/Chart.js/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nnnick/Chart.js/teams","hooks_url":"https://api.github.com/repos/nnnick/Chart.js/hooks","issue_events_url":"https://api.github.com/repos/nnnick/Chart.js/issues/events{/number}","events_url":"https://api.github.com/repos/nnnick/Chart.js/events","assignees_url":"https://api.github.com/repos/nnnick/Chart.js/assignees{/user}","branches_url":"https://api.github.com/repos/nnnick/Chart.js/branches{/branch}","tags_url":"https://api.github.com/repos/nnnick/Chart.js/tags","blobs_url":"https://api.github.com/repos/nnnick/Chart.js/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nnnick/Chart.js/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nnnick/Chart.js/git/refs{/sha}","trees_url":"https://api.github.com/repos/nnnick/Chart.js/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nnnick/Chart.js/statuses/{sha}","languages_url":"https://api.github.com/repos/nnnick/Chart.js/languages","stargazers_url":"https://api.github.com/repos/nnnick/Chart.js/stargazers","contributors_url":"https://api.github.com/repos/nnnick/Chart.js/contributors","subscribers_url":"https://api.github.com/repos/nnnick/Chart.js/subscribers","subscription_url":"https://api.github.com/repos/nnnick/Chart.js/subscription","commits_url":"https://api.github.com/repos/nnnick/Chart.js/commits{/sha}","git_commits_url":"https://api.github.com/repos/nnnick/Chart.js/git/commits{/sha}","comments_url":"https://api.github.com/repos/nnnick/Chart.js/comments{/number}","issue_comment_url":"https://api.github.com/repos/nnnick/Chart.js/issues/comments{/number}","contents_url":"https://api.github.com/repos/nnnick/Chart.js/contents/{+path}","compare_url":"https://api.github.com/repos/nnnick/Chart.js/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nnnick/Chart.js/merges","archive_url":"https://api.github.com/repos/nnnick/Chart.js/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nnnick/Chart.js/downloads","issues_url":"https://api.github.com/repos/nnnick/Chart.js/issues{/number}","pulls_url":"https://api.github.com/repos/nnnick/Chart.js/pulls{/number}","milestones_url":"https://api.github.com/repos/nnnick/Chart.js/milestones{/number}","notifications_url":"https://api.github.com/repos/nnnick/Chart.js/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nnnick/Chart.js/labels{/name}","releases_url":"https://api.github.com/repos/nnnick/Chart.js/releases{/id}","deployments_url":"https://api.github.com/repos/nnnick/Chart.js/deployments","created_at":"2013-03-17T23:56:36Z","updated_at":"2016-02-05T13:04:38Z","pushed_at":"2016-02-05T09:12:10Z","git_url":"git://github.com/nnnick/Chart.js.git","ssh_url":"git@github.com:nnnick/Chart.js.git","clone_url":"https://github.com/nnnick/Chart.js.git","svn_url":"https://github.com/nnnick/Chart.js","homepage":"http://www.chartjs.org/","size":5796,"stargazers_count":18117,"watchers_count":18117,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":true,"forks_count":5634,"mirror_url":null,"open_issues_count":202,"forks":5634,"open_issues":202,"watchers":18117,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978"},"html":{"href":"https://github.com/nnnick/Chart.js/pull/1978"},"issue":{"href":"https://api.github.com/repos/nnnick/Chart.js/issues/1978"},"comments":{"href":"https://api.github.com/repos/nnnick/Chart.js/issues/1978/comments"},"review_comments":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978/comments"},"review_comment":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/nnnick/Chart.js/pulls/1978/commits"},"statuses":{"href":"https://api.github.com/repos/nnnick/Chart.js/statuses/92bc1a04cf8b08d5b61459ac09d799659f2b359d"}}}}