{"action":"created","comment":{"url":"https://api.github.com/repos/lampo/prawn-charts/pulls/comments/58384595","id":58384595,"diff_hunk":"@@ -54,20 +61,28 @@ def text_height\n       end\n \n       def axis_height\n-        points.max - points.min\n+        if only_zero?\n+          100\n+        else\n+          points.max - points.min\n+        end\n       end\n \n       def single_height\n         (bounds.height / text_height).to_i\n       end\n \n-      def list\n-        return percentage_list if percentage?\n+      def list(zero_base = true)\n+        return percentage_list if percentage? || only_zero?\n         return @range.uniq if @range\n         @range =[]\n         min_val = exp(points.max / 4)\n-        result = points.min - (points.min % min_val) - min_val\n-        @range.push(result)\n+        if zero_base","path":"lib/prawn/charts/y_axis.rb","position":64,"original_position":64,"commit_id":"03757c0b0164b196126ba8c1ce945fb8cab30c11","original_commit_id":"03757c0b0164b196126ba8c1ce945fb8cab30c11","user":{"login":"mellowfish","id":1732187,"avatar_url":"https://avatars.githubusercontent.com/u/1732187?v=3","gravatar_id":"","url":"https://api.github.com/users/mellowfish","html_url":"https://github.com/mellowfish","followers_url":"https://api.github.com/users/mellowfish/followers","following_url":"https://api.github.com/users/mellowfish/following{/other_user}","gists_url":"https://api.github.com/users/mellowfish/gists{/gist_id}","starred_url":"https://api.github.com/users/mellowfish/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/mellowfish/subscriptions","organizations_url":"https://api.github.com/users/mellowfish/orgs","repos_url":"https://api.github.com/users/mellowfish/repos","events_url":"https://api.github.com/users/mellowfish/events{/privacy}","received_events_url":"https://api.github.com/users/mellowfish/received_events","type":"User","site_admin":false},"body":"You could do `min_value = if ...` and then do `@range.push(min_value)`. That would lead to a nice method extraction if you ever wanted to later.","created_at":"2016-04-04T14:31:21Z","updated_at":"2016-04-04T14:31:21Z","html_url":"https://github.com/lampo/prawn-charts/pull/3#discussion_r58384595","pull_request_url":"https://api.github.com/repos/lampo/prawn-charts/pulls/3","_links":{"self":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/comments/58384595"},"html":{"href":"https://github.com/lampo/prawn-charts/pull/3#discussion_r58384595"},"pull_request":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/3"}}},"pull_request":{"url":"https://api.github.com/repos/lampo/prawn-charts/pulls/3","id":64995998,"html_url":"https://github.com/lampo/prawn-charts/pull/3","diff_url":"https://github.com/lampo/prawn-charts/pull/3.diff","patch_url":"https://github.com/lampo/prawn-charts/pull/3.patch","issue_url":"https://api.github.com/repos/lampo/prawn-charts/issues/3","number":3,"state":"open","locked":false,"title":"Adds labels to bars and better 0 based y-axis","user":{"login":"farneman","id":160901,"avatar_url":"https://avatars.githubusercontent.com/u/160901?v=3","gravatar_id":"","url":"https://api.github.com/users/farneman","html_url":"https://github.com/farneman","followers_url":"https://api.github.com/users/farneman/followers","following_url":"https://api.github.com/users/farneman/following{/other_user}","gists_url":"https://api.github.com/users/farneman/gists{/gist_id}","starred_url":"https://api.github.com/users/farneman/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/farneman/subscriptions","organizations_url":"https://api.github.com/users/farneman/orgs","repos_url":"https://api.github.com/users/farneman/repos","events_url":"https://api.github.com/users/farneman/events{/privacy}","received_events_url":"https://api.github.com/users/farneman/received_events","type":"User","site_admin":false},"body":"- Adds a value label on top of the bar columns\r\n- Creates a true 0 based Y-axis display\r\n\r\nSome of this work undoes what I did previously in favor of a better solution.","created_at":"2016-04-01T19:50:20Z","updated_at":"2016-04-04T14:31:21Z","closed_at":null,"merged_at":null,"merge_commit_sha":"5f7ef69e81cc7def13a9f8a402a1546dcce060b6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/lampo/prawn-charts/pulls/3/commits","review_comments_url":"https://api.github.com/repos/lampo/prawn-charts/pulls/3/comments","review_comment_url":"https://api.github.com/repos/lampo/prawn-charts/pulls/comments{/number}","comments_url":"https://api.github.com/repos/lampo/prawn-charts/issues/3/comments","statuses_url":"https://api.github.com/repos/lampo/prawn-charts/statuses/03757c0b0164b196126ba8c1ce945fb8cab30c11","head":{"label":"lampo:better-graph-display","ref":"better-graph-display","sha":"03757c0b0164b196126ba8c1ce945fb8cab30c11","user":{"login":"lampo","id":1277745,"avatar_url":"https://avatars.githubusercontent.com/u/1277745?v=3","gravatar_id":"","url":"https://api.github.com/users/lampo","html_url":"https://github.com/lampo","followers_url":"https://api.github.com/users/lampo/followers","following_url":"https://api.github.com/users/lampo/following{/other_user}","gists_url":"https://api.github.com/users/lampo/gists{/gist_id}","starred_url":"https://api.github.com/users/lampo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampo/subscriptions","organizations_url":"https://api.github.com/users/lampo/orgs","repos_url":"https://api.github.com/users/lampo/repos","events_url":"https://api.github.com/users/lampo/events{/privacy}","received_events_url":"https://api.github.com/users/lampo/received_events","type":"Organization","site_admin":false},"repo":{"id":55075564,"name":"prawn-charts","full_name":"lampo/prawn-charts","owner":{"login":"lampo","id":1277745,"avatar_url":"https://avatars.githubusercontent.com/u/1277745?v=3","gravatar_id":"","url":"https://api.github.com/users/lampo","html_url":"https://github.com/lampo","followers_url":"https://api.github.com/users/lampo/followers","following_url":"https://api.github.com/users/lampo/following{/other_user}","gists_url":"https://api.github.com/users/lampo/gists{/gist_id}","starred_url":"https://api.github.com/users/lampo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampo/subscriptions","organizations_url":"https://api.github.com/users/lampo/orgs","repos_url":"https://api.github.com/users/lampo/repos","events_url":"https://api.github.com/users/lampo/events{/privacy}","received_events_url":"https://api.github.com/users/lampo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lampo/prawn-charts","description":"Native Prawn Charts","fork":true,"url":"https://api.github.com/repos/lampo/prawn-charts","forks_url":"https://api.github.com/repos/lampo/prawn-charts/forks","keys_url":"https://api.github.com/repos/lampo/prawn-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lampo/prawn-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lampo/prawn-charts/teams","hooks_url":"https://api.github.com/repos/lampo/prawn-charts/hooks","issue_events_url":"https://api.github.com/repos/lampo/prawn-charts/issues/events{/number}","events_url":"https://api.github.com/repos/lampo/prawn-charts/events","assignees_url":"https://api.github.com/repos/lampo/prawn-charts/assignees{/user}","branches_url":"https://api.github.com/repos/lampo/prawn-charts/branches{/branch}","tags_url":"https://api.github.com/repos/lampo/prawn-charts/tags","blobs_url":"https://api.github.com/repos/lampo/prawn-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lampo/prawn-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lampo/prawn-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/lampo/prawn-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lampo/prawn-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/lampo/prawn-charts/languages","stargazers_url":"https://api.github.com/repos/lampo/prawn-charts/stargazers","contributors_url":"https://api.github.com/repos/lampo/prawn-charts/contributors","subscribers_url":"https://api.github.com/repos/lampo/prawn-charts/subscribers","subscription_url":"https://api.github.com/repos/lampo/prawn-charts/subscription","commits_url":"https://api.github.com/repos/lampo/prawn-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/lampo/prawn-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/lampo/prawn-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/lampo/prawn-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/lampo/prawn-charts/contents/{+path}","compare_url":"https://api.github.com/repos/lampo/prawn-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lampo/prawn-charts/merges","archive_url":"https://api.github.com/repos/lampo/prawn-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lampo/prawn-charts/downloads","issues_url":"https://api.github.com/repos/lampo/prawn-charts/issues{/number}","pulls_url":"https://api.github.com/repos/lampo/prawn-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/lampo/prawn-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/lampo/prawn-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lampo/prawn-charts/labels{/name}","releases_url":"https://api.github.com/repos/lampo/prawn-charts/releases{/id}","deployments_url":"https://api.github.com/repos/lampo/prawn-charts/deployments","created_at":"2016-03-30T15:40:31Z","updated_at":"2016-03-30T15:40:32Z","pushed_at":"2016-04-04T14:25:08Z","git_url":"git://github.com/lampo/prawn-charts.git","ssh_url":"git@github.com:lampo/prawn-charts.git","clone_url":"https://github.com/lampo/prawn-charts.git","svn_url":"https://github.com/lampo/prawn-charts","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"base":{"label":"lampo:master","ref":"master","sha":"758bf76facf5c06c846df3adaaf4bb752d9d2824","user":{"login":"lampo","id":1277745,"avatar_url":"https://avatars.githubusercontent.com/u/1277745?v=3","gravatar_id":"","url":"https://api.github.com/users/lampo","html_url":"https://github.com/lampo","followers_url":"https://api.github.com/users/lampo/followers","following_url":"https://api.github.com/users/lampo/following{/other_user}","gists_url":"https://api.github.com/users/lampo/gists{/gist_id}","starred_url":"https://api.github.com/users/lampo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampo/subscriptions","organizations_url":"https://api.github.com/users/lampo/orgs","repos_url":"https://api.github.com/users/lampo/repos","events_url":"https://api.github.com/users/lampo/events{/privacy}","received_events_url":"https://api.github.com/users/lampo/received_events","type":"Organization","site_admin":false},"repo":{"id":55075564,"name":"prawn-charts","full_name":"lampo/prawn-charts","owner":{"login":"lampo","id":1277745,"avatar_url":"https://avatars.githubusercontent.com/u/1277745?v=3","gravatar_id":"","url":"https://api.github.com/users/lampo","html_url":"https://github.com/lampo","followers_url":"https://api.github.com/users/lampo/followers","following_url":"https://api.github.com/users/lampo/following{/other_user}","gists_url":"https://api.github.com/users/lampo/gists{/gist_id}","starred_url":"https://api.github.com/users/lampo/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lampo/subscriptions","organizations_url":"https://api.github.com/users/lampo/orgs","repos_url":"https://api.github.com/users/lampo/repos","events_url":"https://api.github.com/users/lampo/events{/privacy}","received_events_url":"https://api.github.com/users/lampo/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/lampo/prawn-charts","description":"Native Prawn Charts","fork":true,"url":"https://api.github.com/repos/lampo/prawn-charts","forks_url":"https://api.github.com/repos/lampo/prawn-charts/forks","keys_url":"https://api.github.com/repos/lampo/prawn-charts/keys{/key_id}","collaborators_url":"https://api.github.com/repos/lampo/prawn-charts/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/lampo/prawn-charts/teams","hooks_url":"https://api.github.com/repos/lampo/prawn-charts/hooks","issue_events_url":"https://api.github.com/repos/lampo/prawn-charts/issues/events{/number}","events_url":"https://api.github.com/repos/lampo/prawn-charts/events","assignees_url":"https://api.github.com/repos/lampo/prawn-charts/assignees{/user}","branches_url":"https://api.github.com/repos/lampo/prawn-charts/branches{/branch}","tags_url":"https://api.github.com/repos/lampo/prawn-charts/tags","blobs_url":"https://api.github.com/repos/lampo/prawn-charts/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/lampo/prawn-charts/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/lampo/prawn-charts/git/refs{/sha}","trees_url":"https://api.github.com/repos/lampo/prawn-charts/git/trees{/sha}","statuses_url":"https://api.github.com/repos/lampo/prawn-charts/statuses/{sha}","languages_url":"https://api.github.com/repos/lampo/prawn-charts/languages","stargazers_url":"https://api.github.com/repos/lampo/prawn-charts/stargazers","contributors_url":"https://api.github.com/repos/lampo/prawn-charts/contributors","subscribers_url":"https://api.github.com/repos/lampo/prawn-charts/subscribers","subscription_url":"https://api.github.com/repos/lampo/prawn-charts/subscription","commits_url":"https://api.github.com/repos/lampo/prawn-charts/commits{/sha}","git_commits_url":"https://api.github.com/repos/lampo/prawn-charts/git/commits{/sha}","comments_url":"https://api.github.com/repos/lampo/prawn-charts/comments{/number}","issue_comment_url":"https://api.github.com/repos/lampo/prawn-charts/issues/comments{/number}","contents_url":"https://api.github.com/repos/lampo/prawn-charts/contents/{+path}","compare_url":"https://api.github.com/repos/lampo/prawn-charts/compare/{base}...{head}","merges_url":"https://api.github.com/repos/lampo/prawn-charts/merges","archive_url":"https://api.github.com/repos/lampo/prawn-charts/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/lampo/prawn-charts/downloads","issues_url":"https://api.github.com/repos/lampo/prawn-charts/issues{/number}","pulls_url":"https://api.github.com/repos/lampo/prawn-charts/pulls{/number}","milestones_url":"https://api.github.com/repos/lampo/prawn-charts/milestones{/number}","notifications_url":"https://api.github.com/repos/lampo/prawn-charts/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/lampo/prawn-charts/labels{/name}","releases_url":"https://api.github.com/repos/lampo/prawn-charts/releases{/id}","deployments_url":"https://api.github.com/repos/lampo/prawn-charts/deployments","created_at":"2016-03-30T15:40:31Z","updated_at":"2016-03-30T15:40:32Z","pushed_at":"2016-04-04T14:25:08Z","git_url":"git://github.com/lampo/prawn-charts.git","ssh_url":"git@github.com:lampo/prawn-charts.git","clone_url":"https://github.com/lampo/prawn-charts.git","svn_url":"https://github.com/lampo/prawn-charts","homepage":null,"size":47,"stargazers_count":0,"watchers_count":0,"language":"Ruby","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":1,"forks":0,"open_issues":1,"watchers":0,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/3"},"html":{"href":"https://github.com/lampo/prawn-charts/pull/3"},"issue":{"href":"https://api.github.com/repos/lampo/prawn-charts/issues/3"},"comments":{"href":"https://api.github.com/repos/lampo/prawn-charts/issues/3/comments"},"review_comments":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/3/comments"},"review_comment":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/lampo/prawn-charts/pulls/3/commits"},"statuses":{"href":"https://api.github.com/repos/lampo/prawn-charts/statuses/03757c0b0164b196126ba8c1ce945fb8cab30c11"}}}}