{"action":"closed","number":28,"pull_request":{"url":"https://api.github.com/repos/gizak/termui/pulls/28","id":33323068,"html_url":"https://github.com/gizak/termui/pull/28","diff_url":"https://github.com/gizak/termui/pull/28.diff","patch_url":"https://github.com/gizak/termui/pull/28.patch","issue_url":"https://api.github.com/repos/gizak/termui/issues/28","number":28,"state":"closed","locked":false,"title":"Fix an OutofIndex Panic on empty bargraphs and introduce SetMax()","user":{"login":"dhilipkumars","id":10920260,"avatar_url":"https://avatars.githubusercontent.com/u/10920260?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilipkumars","html_url":"https://github.com/dhilipkumars","followers_url":"https://api.github.com/users/dhilipkumars/followers","following_url":"https://api.github.com/users/dhilipkumars/following{/other_user}","gists_url":"https://api.github.com/users/dhilipkumars/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilipkumars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilipkumars/subscriptions","organizations_url":"https://api.github.com/users/dhilipkumars/orgs","repos_url":"https://api.github.com/users/dhilipkumars/repos","events_url":"https://api.github.com/users/dhilipkumars/events{/privacy}","received_events_url":"https://api.github.com/users/dhilipkumars/received_events","type":"User","site_admin":false},"body":"Hi,\r\n\r\nFirst of all thanks for this awesome package. :-)\r\n\r\nWhen the barGraph's Data[] is null it produces panic like below. \r\n\r\n```\r\npanic: runtime error: index out of range\r\n\r\ngoroutine 1 [running]:\r\ngithub.com/gizak/termui.(*BarChart).layout(0xc208050280)\r\n        /home/cf/gopkg/src/github.com/gizak/termui/bar.go:62 +0x577\r\ngithub.com/gizak/termui.(*BarChart).Buffer(0xc208050280, 0x0, 0x0, 0x0)\r\n        /home/cf/gopkg/src/github.com/gizak/termui/bar.go:74 +0xb5\r\ngithub.com/gizak/termui.Render(0xc20811d720, 0x4, 0x4)\r\n        /home/cf/gopkg/src/github.com/gizak/termui/render.go:52 +0xc7\r\ngithub.com/cloudfoundry-incubator/lattice/ltc/app_examiner/command_factory.(*AppExaminerCommandFactory).printDistributionChart(0xc20802d3c0, 0x3b9aca00, 0x0, 0x0)\r\n        /home/cf/gopkg/src/github.com/cloudfoundry-incubator/lattice/ltc/Godeps/_workspace/src/github.com/cloudfoundry-incubator/lattice/ltc/app_examiner/command_factory/app_examiner_command_factory.go:483 +0xfd5\r\n``` \r\n\r\nPlus sometime when i want my bar graph to always have maxValue as 100 (while calculating percentage) it does not work.  The maximum among data[] is always considered, so my graph becomes less realistic. \r\n\r\nThis allows us have more realistic graph and also we are able to plot empty barGraphs. ","created_at":"2015-04-15T05:07:21Z","updated_at":"2015-04-15T21:38:40Z","closed_at":"2015-04-15T21:38:40Z","merged_at":"2015-04-15T21:38:40Z","merge_commit_sha":"2592c8505e06932b5a1b65bd00726aae2d672cc6","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/gizak/termui/pulls/28/commits","review_comments_url":"https://api.github.com/repos/gizak/termui/pulls/28/comments","review_comment_url":"https://api.github.com/repos/gizak/termui/pulls/comments{/number}","comments_url":"https://api.github.com/repos/gizak/termui/issues/28/comments","statuses_url":"https://api.github.com/repos/gizak/termui/statuses/99973c9c71b3b1b2b103ba5fa883239f3ea12b72","head":{"label":"dhilipkumars:BarGraphFix","ref":"BarGraphFix","sha":"99973c9c71b3b1b2b103ba5fa883239f3ea12b72","user":{"login":"dhilipkumars","id":10920260,"avatar_url":"https://avatars.githubusercontent.com/u/10920260?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilipkumars","html_url":"https://github.com/dhilipkumars","followers_url":"https://api.github.com/users/dhilipkumars/followers","following_url":"https://api.github.com/users/dhilipkumars/following{/other_user}","gists_url":"https://api.github.com/users/dhilipkumars/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilipkumars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilipkumars/subscriptions","organizations_url":"https://api.github.com/users/dhilipkumars/orgs","repos_url":"https://api.github.com/users/dhilipkumars/repos","events_url":"https://api.github.com/users/dhilipkumars/events{/privacy}","received_events_url":"https://api.github.com/users/dhilipkumars/received_events","type":"User","site_admin":false},"repo":{"id":33666268,"name":"termui","full_name":"dhilipkumars/termui","owner":{"login":"dhilipkumars","id":10920260,"avatar_url":"https://avatars.githubusercontent.com/u/10920260?v=3","gravatar_id":"","url":"https://api.github.com/users/dhilipkumars","html_url":"https://github.com/dhilipkumars","followers_url":"https://api.github.com/users/dhilipkumars/followers","following_url":"https://api.github.com/users/dhilipkumars/following{/other_user}","gists_url":"https://api.github.com/users/dhilipkumars/gists{/gist_id}","starred_url":"https://api.github.com/users/dhilipkumars/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/dhilipkumars/subscriptions","organizations_url":"https://api.github.com/users/dhilipkumars/orgs","repos_url":"https://api.github.com/users/dhilipkumars/repos","events_url":"https://api.github.com/users/dhilipkumars/events{/privacy}","received_events_url":"https://api.github.com/users/dhilipkumars/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/dhilipkumars/termui","description":"Golang terminal dashboard","fork":true,"url":"https://api.github.com/repos/dhilipkumars/termui","forks_url":"https://api.github.com/repos/dhilipkumars/termui/forks","keys_url":"https://api.github.com/repos/dhilipkumars/termui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/dhilipkumars/termui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/dhilipkumars/termui/teams","hooks_url":"https://api.github.com/repos/dhilipkumars/termui/hooks","issue_events_url":"https://api.github.com/repos/dhilipkumars/termui/issues/events{/number}","events_url":"https://api.github.com/repos/dhilipkumars/termui/events","assignees_url":"https://api.github.com/repos/dhilipkumars/termui/assignees{/user}","branches_url":"https://api.github.com/repos/dhilipkumars/termui/branches{/branch}","tags_url":"https://api.github.com/repos/dhilipkumars/termui/tags","blobs_url":"https://api.github.com/repos/dhilipkumars/termui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/dhilipkumars/termui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/dhilipkumars/termui/git/refs{/sha}","trees_url":"https://api.github.com/repos/dhilipkumars/termui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/dhilipkumars/termui/statuses/{sha}","languages_url":"https://api.github.com/repos/dhilipkumars/termui/languages","stargazers_url":"https://api.github.com/repos/dhilipkumars/termui/stargazers","contributors_url":"https://api.github.com/repos/dhilipkumars/termui/contributors","subscribers_url":"https://api.github.com/repos/dhilipkumars/termui/subscribers","subscription_url":"https://api.github.com/repos/dhilipkumars/termui/subscription","commits_url":"https://api.github.com/repos/dhilipkumars/termui/commits{/sha}","git_commits_url":"https://api.github.com/repos/dhilipkumars/termui/git/commits{/sha}","comments_url":"https://api.github.com/repos/dhilipkumars/termui/comments{/number}","issue_comment_url":"https://api.github.com/repos/dhilipkumars/termui/issues/comments{/number}","contents_url":"https://api.github.com/repos/dhilipkumars/termui/contents/{+path}","compare_url":"https://api.github.com/repos/dhilipkumars/termui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/dhilipkumars/termui/merges","archive_url":"https://api.github.com/repos/dhilipkumars/termui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/dhilipkumars/termui/downloads","issues_url":"https://api.github.com/repos/dhilipkumars/termui/issues{/number}","pulls_url":"https://api.github.com/repos/dhilipkumars/termui/pulls{/number}","milestones_url":"https://api.github.com/repos/dhilipkumars/termui/milestones{/number}","notifications_url":"https://api.github.com/repos/dhilipkumars/termui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/dhilipkumars/termui/labels{/name}","releases_url":"https://api.github.com/repos/dhilipkumars/termui/releases{/id}","created_at":"2015-04-09T11:56:03Z","updated_at":"2015-04-09T11:56:03Z","pushed_at":"2015-04-15T05:00:06Z","git_url":"git://github.com/dhilipkumars/termui.git","ssh_url":"git@github.com:dhilipkumars/termui.git","clone_url":"https://github.com/dhilipkumars/termui.git","svn_url":"https://github.com/dhilipkumars/termui","homepage":"","size":5068,"stargazers_count":0,"watchers_count":0,"language":"Go","has_issues":false,"has_downloads":true,"has_wiki":true,"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":"gizak:master","ref":"master","sha":"b3e1431d46f96550cfa78defd2ee7ee022fddecc","user":{"login":"gizak","id":2100512,"avatar_url":"https://avatars.githubusercontent.com/u/2100512?v=3","gravatar_id":"","url":"https://api.github.com/users/gizak","html_url":"https://github.com/gizak","followers_url":"https://api.github.com/users/gizak/followers","following_url":"https://api.github.com/users/gizak/following{/other_user}","gists_url":"https://api.github.com/users/gizak/gists{/gist_id}","starred_url":"https://api.github.com/users/gizak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizak/subscriptions","organizations_url":"https://api.github.com/users/gizak/orgs","repos_url":"https://api.github.com/users/gizak/repos","events_url":"https://api.github.com/users/gizak/events{/privacy}","received_events_url":"https://api.github.com/users/gizak/received_events","type":"User","site_admin":false},"repo":{"id":30245748,"name":"termui","full_name":"gizak/termui","owner":{"login":"gizak","id":2100512,"avatar_url":"https://avatars.githubusercontent.com/u/2100512?v=3","gravatar_id":"","url":"https://api.github.com/users/gizak","html_url":"https://github.com/gizak","followers_url":"https://api.github.com/users/gizak/followers","following_url":"https://api.github.com/users/gizak/following{/other_user}","gists_url":"https://api.github.com/users/gizak/gists{/gist_id}","starred_url":"https://api.github.com/users/gizak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizak/subscriptions","organizations_url":"https://api.github.com/users/gizak/orgs","repos_url":"https://api.github.com/users/gizak/repos","events_url":"https://api.github.com/users/gizak/events{/privacy}","received_events_url":"https://api.github.com/users/gizak/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/gizak/termui","description":"Golang terminal dashboard","fork":false,"url":"https://api.github.com/repos/gizak/termui","forks_url":"https://api.github.com/repos/gizak/termui/forks","keys_url":"https://api.github.com/repos/gizak/termui/keys{/key_id}","collaborators_url":"https://api.github.com/repos/gizak/termui/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/gizak/termui/teams","hooks_url":"https://api.github.com/repos/gizak/termui/hooks","issue_events_url":"https://api.github.com/repos/gizak/termui/issues/events{/number}","events_url":"https://api.github.com/repos/gizak/termui/events","assignees_url":"https://api.github.com/repos/gizak/termui/assignees{/user}","branches_url":"https://api.github.com/repos/gizak/termui/branches{/branch}","tags_url":"https://api.github.com/repos/gizak/termui/tags","blobs_url":"https://api.github.com/repos/gizak/termui/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/gizak/termui/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/gizak/termui/git/refs{/sha}","trees_url":"https://api.github.com/repos/gizak/termui/git/trees{/sha}","statuses_url":"https://api.github.com/repos/gizak/termui/statuses/{sha}","languages_url":"https://api.github.com/repos/gizak/termui/languages","stargazers_url":"https://api.github.com/repos/gizak/termui/stargazers","contributors_url":"https://api.github.com/repos/gizak/termui/contributors","subscribers_url":"https://api.github.com/repos/gizak/termui/subscribers","subscription_url":"https://api.github.com/repos/gizak/termui/subscription","commits_url":"https://api.github.com/repos/gizak/termui/commits{/sha}","git_commits_url":"https://api.github.com/repos/gizak/termui/git/commits{/sha}","comments_url":"https://api.github.com/repos/gizak/termui/comments{/number}","issue_comment_url":"https://api.github.com/repos/gizak/termui/issues/comments{/number}","contents_url":"https://api.github.com/repos/gizak/termui/contents/{+path}","compare_url":"https://api.github.com/repos/gizak/termui/compare/{base}...{head}","merges_url":"https://api.github.com/repos/gizak/termui/merges","archive_url":"https://api.github.com/repos/gizak/termui/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/gizak/termui/downloads","issues_url":"https://api.github.com/repos/gizak/termui/issues{/number}","pulls_url":"https://api.github.com/repos/gizak/termui/pulls{/number}","milestones_url":"https://api.github.com/repos/gizak/termui/milestones{/number}","notifications_url":"https://api.github.com/repos/gizak/termui/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/gizak/termui/labels{/name}","releases_url":"https://api.github.com/repos/gizak/termui/releases{/id}","created_at":"2015-02-03T14:09:27Z","updated_at":"2015-04-15T20:24:53Z","pushed_at":"2015-04-15T21:38:40Z","git_url":"git://github.com/gizak/termui.git","ssh_url":"git@github.com:gizak/termui.git","clone_url":"https://github.com/gizak/termui.git","svn_url":"https://github.com/gizak/termui","homepage":"","size":5068,"stargazers_count":3125,"watchers_count":3125,"language":"Go","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":87,"mirror_url":null,"open_issues_count":12,"forks":87,"open_issues":12,"watchers":3125,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/gizak/termui/pulls/28"},"html":{"href":"https://github.com/gizak/termui/pull/28"},"issue":{"href":"https://api.github.com/repos/gizak/termui/issues/28"},"comments":{"href":"https://api.github.com/repos/gizak/termui/issues/28/comments"},"review_comments":{"href":"https://api.github.com/repos/gizak/termui/pulls/28/comments"},"review_comment":{"href":"https://api.github.com/repos/gizak/termui/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/gizak/termui/pulls/28/commits"},"statuses":{"href":"https://api.github.com/repos/gizak/termui/statuses/99973c9c71b3b1b2b103ba5fa883239f3ea12b72"}},"merged":true,"mergeable":null,"mergeable_state":"unknown","merged_by":{"login":"gizak","id":2100512,"avatar_url":"https://avatars.githubusercontent.com/u/2100512?v=3","gravatar_id":"","url":"https://api.github.com/users/gizak","html_url":"https://github.com/gizak","followers_url":"https://api.github.com/users/gizak/followers","following_url":"https://api.github.com/users/gizak/following{/other_user}","gists_url":"https://api.github.com/users/gizak/gists{/gist_id}","starred_url":"https://api.github.com/users/gizak/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/gizak/subscriptions","organizations_url":"https://api.github.com/users/gizak/orgs","repos_url":"https://api.github.com/users/gizak/repos","events_url":"https://api.github.com/users/gizak/events{/privacy}","received_events_url":"https://api.github.com/users/gizak/received_events","type":"User","site_admin":false},"comments":1,"review_comments":0,"commits":1,"additions":12,"deletions":1,"changed_files":1}}