{"action":"opened","number":1395,"pull_request":{"url":"https://api.github.com/repos/masayuki0812/c3/pulls/1395","id":46061223,"html_url":"https://github.com/masayuki0812/c3/pull/1395","diff_url":"https://github.com/masayuki0812/c3/pull/1395.diff","patch_url":"https://github.com/masayuki0812/c3/pull/1395.patch","issue_url":"https://api.github.com/repos/masayuki0812/c3/issues/1395","number":1395,"state":"open","locked":false,"title":"More accurate positioning of y axis tick texts for larger font sizes","user":{"login":"900k","id":5701903,"avatar_url":"https://avatars.githubusercontent.com/u/5701903?v=3","gravatar_id":"","url":"https://api.github.com/users/900k","html_url":"https://github.com/900k","followers_url":"https://api.github.com/users/900k/followers","following_url":"https://api.github.com/users/900k/following{/other_user}","gists_url":"https://api.github.com/users/900k/gists{/gist_id}","starred_url":"https://api.github.com/users/900k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/900k/subscriptions","organizations_url":"https://api.github.com/users/900k/orgs","repos_url":"https://api.github.com/users/900k/repos","events_url":"https://api.github.com/users/900k/events{/privacy}","received_events_url":"https://api.github.com/users/900k/received_events","type":"User","site_admin":false},"body":"While using c3js in a project where people demanded larger font sizes for axis ticks, I noticed that changing the font size to 12pt is causing the y axis tick texts to be vertically out of position relative to the actual ticks. The tick texts are not vertically centred at the ticks any more. Here is an example for 12pt:\r\n![12pt_ugly_](https://cloud.githubusercontent.com/assets/5701903/10112516/2f05baf8-63dc-11e5-9fed-5db600c43683.png)\r\nThis problem becomes more obvious if you increase the font size. Here an example for 20pt:\r\n![20pt_ugly](https://cloud.githubusercontent.com/assets/5701903/10112571/7f5f1292-63dc-11e5-9268-84478759b608.png)\r\nThe changes applied by me lead to the following results for 12pt and 20pt:\r\n![12pt](https://cloud.githubusercontent.com/assets/5701903/10112603/c86ccce0-63dc-11e5-8661-3267fc8bb295.png)\r\n![20pt](https://cloud.githubusercontent.com/assets/5701903/10112604/cdd4908c-63dc-11e5-8b02-9a162eb227c9.png)\r\nAlso tried other font sizes from 6pt to 30pt and the results are still accurate.\r\nI've found the reason for this problem in the methods tspanDy(d, i) and textFormatted(d). In tspanDy(d, i), a fixed value (3) has been used to centre the tick text vertically, but using a quarter of the height of a char to compute the vertical offset of tick texts results in a more accurate positioning. The method textFormatted(d) is used to detect the height of the chars in the tick texts. But it fails if the tick \"text\" is a number. To solve this issue I ensured that textFormatted(d) will return a string in any case.\r\n\r\nDo you think these changes are ok?","created_at":"2015-09-25T21:40:08Z","updated_at":"2015-09-25T21:40:08Z","closed_at":null,"merged_at":null,"merge_commit_sha":null,"assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/masayuki0812/c3/pulls/1395/commits","review_comments_url":"https://api.github.com/repos/masayuki0812/c3/pulls/1395/comments","review_comment_url":"https://api.github.com/repos/masayuki0812/c3/pulls/comments{/number}","comments_url":"https://api.github.com/repos/masayuki0812/c3/issues/1395/comments","statuses_url":"https://api.github.com/repos/masayuki0812/c3/statuses/2dd114f249bab7c781dac3fef0035ada686609bc","head":{"label":"900k:master","ref":"master","sha":"2dd114f249bab7c781dac3fef0035ada686609bc","user":{"login":"900k","id":5701903,"avatar_url":"https://avatars.githubusercontent.com/u/5701903?v=3","gravatar_id":"","url":"https://api.github.com/users/900k","html_url":"https://github.com/900k","followers_url":"https://api.github.com/users/900k/followers","following_url":"https://api.github.com/users/900k/following{/other_user}","gists_url":"https://api.github.com/users/900k/gists{/gist_id}","starred_url":"https://api.github.com/users/900k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/900k/subscriptions","organizations_url":"https://api.github.com/users/900k/orgs","repos_url":"https://api.github.com/users/900k/repos","events_url":"https://api.github.com/users/900k/events{/privacy}","received_events_url":"https://api.github.com/users/900k/received_events","type":"User","site_admin":false},"repo":{"id":43173490,"name":"c3","full_name":"900k/c3","owner":{"login":"900k","id":5701903,"avatar_url":"https://avatars.githubusercontent.com/u/5701903?v=3","gravatar_id":"","url":"https://api.github.com/users/900k","html_url":"https://github.com/900k","followers_url":"https://api.github.com/users/900k/followers","following_url":"https://api.github.com/users/900k/following{/other_user}","gists_url":"https://api.github.com/users/900k/gists{/gist_id}","starred_url":"https://api.github.com/users/900k/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/900k/subscriptions","organizations_url":"https://api.github.com/users/900k/orgs","repos_url":"https://api.github.com/users/900k/repos","events_url":"https://api.github.com/users/900k/events{/privacy}","received_events_url":"https://api.github.com/users/900k/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/900k/c3","description":"A D3-based reusable chart library","fork":true,"url":"https://api.github.com/repos/900k/c3","forks_url":"https://api.github.com/repos/900k/c3/forks","keys_url":"https://api.github.com/repos/900k/c3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/900k/c3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/900k/c3/teams","hooks_url":"https://api.github.com/repos/900k/c3/hooks","issue_events_url":"https://api.github.com/repos/900k/c3/issues/events{/number}","events_url":"https://api.github.com/repos/900k/c3/events","assignees_url":"https://api.github.com/repos/900k/c3/assignees{/user}","branches_url":"https://api.github.com/repos/900k/c3/branches{/branch}","tags_url":"https://api.github.com/repos/900k/c3/tags","blobs_url":"https://api.github.com/repos/900k/c3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/900k/c3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/900k/c3/git/refs{/sha}","trees_url":"https://api.github.com/repos/900k/c3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/900k/c3/statuses/{sha}","languages_url":"https://api.github.com/repos/900k/c3/languages","stargazers_url":"https://api.github.com/repos/900k/c3/stargazers","contributors_url":"https://api.github.com/repos/900k/c3/contributors","subscribers_url":"https://api.github.com/repos/900k/c3/subscribers","subscription_url":"https://api.github.com/repos/900k/c3/subscription","commits_url":"https://api.github.com/repos/900k/c3/commits{/sha}","git_commits_url":"https://api.github.com/repos/900k/c3/git/commits{/sha}","comments_url":"https://api.github.com/repos/900k/c3/comments{/number}","issue_comment_url":"https://api.github.com/repos/900k/c3/issues/comments{/number}","contents_url":"https://api.github.com/repos/900k/c3/contents/{+path}","compare_url":"https://api.github.com/repos/900k/c3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/900k/c3/merges","archive_url":"https://api.github.com/repos/900k/c3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/900k/c3/downloads","issues_url":"https://api.github.com/repos/900k/c3/issues{/number}","pulls_url":"https://api.github.com/repos/900k/c3/pulls{/number}","milestones_url":"https://api.github.com/repos/900k/c3/milestones{/number}","notifications_url":"https://api.github.com/repos/900k/c3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/900k/c3/labels{/name}","releases_url":"https://api.github.com/repos/900k/c3/releases{/id}","created_at":"2015-09-25T20:16:59Z","updated_at":"2015-09-25T20:17:01Z","pushed_at":"2015-09-25T20:53:44Z","git_url":"git://github.com/900k/c3.git","ssh_url":"git@github.com:900k/c3.git","clone_url":"https://github.com/900k/c3.git","svn_url":"https://github.com/900k/c3","homepage":"c3js.org","size":10576,"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":"masayuki0812:master","ref":"master","sha":"931109f8269688b8d623b4523335670dd813b4dc","user":{"login":"masayuki0812","id":1142423,"avatar_url":"https://avatars.githubusercontent.com/u/1142423?v=3","gravatar_id":"","url":"https://api.github.com/users/masayuki0812","html_url":"https://github.com/masayuki0812","followers_url":"https://api.github.com/users/masayuki0812/followers","following_url":"https://api.github.com/users/masayuki0812/following{/other_user}","gists_url":"https://api.github.com/users/masayuki0812/gists{/gist_id}","starred_url":"https://api.github.com/users/masayuki0812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masayuki0812/subscriptions","organizations_url":"https://api.github.com/users/masayuki0812/orgs","repos_url":"https://api.github.com/users/masayuki0812/repos","events_url":"https://api.github.com/users/masayuki0812/events{/privacy}","received_events_url":"https://api.github.com/users/masayuki0812/received_events","type":"User","site_admin":false},"repo":{"id":11496279,"name":"c3","full_name":"masayuki0812/c3","owner":{"login":"masayuki0812","id":1142423,"avatar_url":"https://avatars.githubusercontent.com/u/1142423?v=3","gravatar_id":"","url":"https://api.github.com/users/masayuki0812","html_url":"https://github.com/masayuki0812","followers_url":"https://api.github.com/users/masayuki0812/followers","following_url":"https://api.github.com/users/masayuki0812/following{/other_user}","gists_url":"https://api.github.com/users/masayuki0812/gists{/gist_id}","starred_url":"https://api.github.com/users/masayuki0812/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/masayuki0812/subscriptions","organizations_url":"https://api.github.com/users/masayuki0812/orgs","repos_url":"https://api.github.com/users/masayuki0812/repos","events_url":"https://api.github.com/users/masayuki0812/events{/privacy}","received_events_url":"https://api.github.com/users/masayuki0812/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/masayuki0812/c3","description":"A D3-based reusable chart library","fork":false,"url":"https://api.github.com/repos/masayuki0812/c3","forks_url":"https://api.github.com/repos/masayuki0812/c3/forks","keys_url":"https://api.github.com/repos/masayuki0812/c3/keys{/key_id}","collaborators_url":"https://api.github.com/repos/masayuki0812/c3/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/masayuki0812/c3/teams","hooks_url":"https://api.github.com/repos/masayuki0812/c3/hooks","issue_events_url":"https://api.github.com/repos/masayuki0812/c3/issues/events{/number}","events_url":"https://api.github.com/repos/masayuki0812/c3/events","assignees_url":"https://api.github.com/repos/masayuki0812/c3/assignees{/user}","branches_url":"https://api.github.com/repos/masayuki0812/c3/branches{/branch}","tags_url":"https://api.github.com/repos/masayuki0812/c3/tags","blobs_url":"https://api.github.com/repos/masayuki0812/c3/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/masayuki0812/c3/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/masayuki0812/c3/git/refs{/sha}","trees_url":"https://api.github.com/repos/masayuki0812/c3/git/trees{/sha}","statuses_url":"https://api.github.com/repos/masayuki0812/c3/statuses/{sha}","languages_url":"https://api.github.com/repos/masayuki0812/c3/languages","stargazers_url":"https://api.github.com/repos/masayuki0812/c3/stargazers","contributors_url":"https://api.github.com/repos/masayuki0812/c3/contributors","subscribers_url":"https://api.github.com/repos/masayuki0812/c3/subscribers","subscription_url":"https://api.github.com/repos/masayuki0812/c3/subscription","commits_url":"https://api.github.com/repos/masayuki0812/c3/commits{/sha}","git_commits_url":"https://api.github.com/repos/masayuki0812/c3/git/commits{/sha}","comments_url":"https://api.github.com/repos/masayuki0812/c3/comments{/number}","issue_comment_url":"https://api.github.com/repos/masayuki0812/c3/issues/comments{/number}","contents_url":"https://api.github.com/repos/masayuki0812/c3/contents/{+path}","compare_url":"https://api.github.com/repos/masayuki0812/c3/compare/{base}...{head}","merges_url":"https://api.github.com/repos/masayuki0812/c3/merges","archive_url":"https://api.github.com/repos/masayuki0812/c3/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/masayuki0812/c3/downloads","issues_url":"https://api.github.com/repos/masayuki0812/c3/issues{/number}","pulls_url":"https://api.github.com/repos/masayuki0812/c3/pulls{/number}","milestones_url":"https://api.github.com/repos/masayuki0812/c3/milestones{/number}","notifications_url":"https://api.github.com/repos/masayuki0812/c3/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/masayuki0812/c3/labels{/name}","releases_url":"https://api.github.com/repos/masayuki0812/c3/releases{/id}","created_at":"2013-07-18T06:51:40Z","updated_at":"2015-09-25T19:15:26Z","pushed_at":"2015-09-22T11:36:29Z","git_url":"git://github.com/masayuki0812/c3.git","ssh_url":"git@github.com:masayuki0812/c3.git","clone_url":"https://github.com/masayuki0812/c3.git","svn_url":"https://github.com/masayuki0812/c3","homepage":"c3js.org","size":10576,"stargazers_count":4784,"watchers_count":4784,"language":"JavaScript","has_issues":true,"has_downloads":true,"has_wiki":false,"has_pages":false,"forks_count":624,"mirror_url":null,"open_issues_count":398,"forks":624,"open_issues":398,"watchers":4784,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/masayuki0812/c3/pulls/1395"},"html":{"href":"https://github.com/masayuki0812/c3/pull/1395"},"issue":{"href":"https://api.github.com/repos/masayuki0812/c3/issues/1395"},"comments":{"href":"https://api.github.com/repos/masayuki0812/c3/issues/1395/comments"},"review_comments":{"href":"https://api.github.com/repos/masayuki0812/c3/pulls/1395/comments"},"review_comment":{"href":"https://api.github.com/repos/masayuki0812/c3/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/masayuki0812/c3/pulls/1395/commits"},"statuses":{"href":"https://api.github.com/repos/masayuki0812/c3/statuses/2dd114f249bab7c781dac3fef0035ada686609bc"}},"merged":false,"mergeable":null,"mergeable_state":"unknown","merged_by":null,"comments":0,"review_comments":0,"commits":2,"additions":2,"deletions":2,"changed_files":1}}