{"action":"opened","issue":{"url":"https://api.github.com/repos/i-schuetz/SwiftCharts/issues/152","repository_url":"https://api.github.com/repos/i-schuetz/SwiftCharts","labels_url":"https://api.github.com/repos/i-schuetz/SwiftCharts/issues/152/labels{/name}","comments_url":"https://api.github.com/repos/i-schuetz/SwiftCharts/issues/152/comments","events_url":"https://api.github.com/repos/i-schuetz/SwiftCharts/issues/152/events","html_url":"https://github.com/i-schuetz/SwiftCharts/issues/152","id":169977505,"number":152,"title":"Building bar charts with custom data using generators","user":{"login":"ryancoughlin","id":1182341,"avatar_url":"https://avatars.githubusercontent.com/u/1182341?v=3","gravatar_id":"","url":"https://api.github.com/users/ryancoughlin","html_url":"https://github.com/ryancoughlin","followers_url":"https://api.github.com/users/ryancoughlin/followers","following_url":"https://api.github.com/users/ryancoughlin/following{/other_user}","gists_url":"https://api.github.com/users/ryancoughlin/gists{/gist_id}","starred_url":"https://api.github.com/users/ryancoughlin/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/ryancoughlin/subscriptions","organizations_url":"https://api.github.com/users/ryancoughlin/orgs","repos_url":"https://api.github.com/users/ryancoughlin/repos","events_url":"https://api.github.com/users/ryancoughlin/events{/privacy}","received_events_url":"https://api.github.com/users/ryancoughlin/received_events","type":"User","site_admin":false},"labels":[],"state":"open","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":0,"created_at":"2016-08-08T17:23:01Z","updated_at":"2016-08-08T17:23:01Z","closed_at":null,"body":"I created the bar chart below using a loop and creating a new view and then adding all those views to a scrollview. I have a `Wind` object that stores the values you see below:\r\n\r\n<img width=\"375\" alt=\"screen shot 2016-08-08 at 1 12 32 pm\" src=\"https://cloud.githubusercontent.com/assets/1182341/17488974/d2021de6-5d69-11e6-9654-2aced21e568b.png\">\r\n\r\nUsing the view generators you extend with this library I would be able to make a new label for wind speed (the label within the bar) and the wind direction (the image view above the bar). My confusion is with populating those views with data from my `Wind` object: wind direction in degrees to rotate `UIImage` and label text as a `String`.\r\n\r\nI would pass it an array of `ChartPoints` but `ChartPoint` is only aware of it's axis values. Is it possible to get an index within a view generator and grab data from `Wind` to populate those custom views, is there? Rough example:\r\n\r\n```\r\n        let windDirectionImageLayer = {(chartPointModel: ChartPointLayerModel, layer: ChartPointsLayer, chart: Chart) -> UIView? in\r\n\r\n        let image = UIImageView(image: \"windDirection\")\r\n\r\n        // Get some index, somehow?\r\n        let windAtIndex = windViewModel[i]\r\n        \r\n        // Rotate `image` with `windAtIndex.direction`\r\n\r\n            return image\r\n        }\r\n```\r\n"}}
{"actor":{"display_login":"ryancoughlin"}}