{"action":"created","issue":{"url":"https://api.github.com/repos/danielgindi/Charts/issues/1424","repository_url":"https://api.github.com/repos/danielgindi/Charts","labels_url":"https://api.github.com/repos/danielgindi/Charts/issues/1424/labels{/name}","comments_url":"https://api.github.com/repos/danielgindi/Charts/issues/1424/comments","events_url":"https://api.github.com/repos/danielgindi/Charts/issues/1424/events","html_url":"https://github.com/danielgindi/Charts/issues/1424","id":176165122,"number":1424,"title":"Highlight sync between combined and line views","user":{"login":"moon47usaco","id":15712871,"avatar_url":"https://avatars.githubusercontent.com/u/15712871?v=3","gravatar_id":"","url":"https://api.github.com/users/moon47usaco","html_url":"https://github.com/moon47usaco","followers_url":"https://api.github.com/users/moon47usaco/followers","following_url":"https://api.github.com/users/moon47usaco/following{/other_user}","gists_url":"https://api.github.com/users/moon47usaco/gists{/gist_id}","starred_url":"https://api.github.com/users/moon47usaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moon47usaco/subscriptions","organizations_url":"https://api.github.com/users/moon47usaco/orgs","repos_url":"https://api.github.com/users/moon47usaco/repos","events_url":"https://api.github.com/users/moon47usaco/events{/privacy}","received_events_url":"https://api.github.com/users/moon47usaco/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":6,"created_at":"2016-09-10T07:27:03Z","updated_at":"2016-09-13T04:49:02Z","closed_at":"2016-09-13T00:44:13Z","body":"I am having issues with getting the crosshairs or highlight line to sync with two chart views I have.\r\n\r\nI have two different problems, second one is detailed in next comment:\r\n\r\nFirst and most important is the passing of the highlight line to the other chart:\r\n\r\nThe top view is a combined chart view with a candlestick chart and a line chart.\r\n\r\nThe bottom view is a line chart. All data is from the same source with same xValues. The yValues are the same just adjusted to illustrate the issue I am having.\r\n\r\nYou can see an example of the code: here https://github.com/moon47usaco/Highlight_Sync-01\r\n\r\nI am using the bellow function to pass the highlight value to the other chart:\r\n\r\n```\r\n    func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight) {\r\n        if  chartView == combinedChartView {\r\n            lineChartView.highlightValues([highlight])\r\n        }else {\r\n            combinedChartView.highlightValues([highlight])\r\n        }\r\n    }\r\n```\r\n\r\nThis works fine for the candlestick or combined chart to pass values to the lower line chart but not the other way around.\r\n\r\nI have the line chart in the upper combined view set to `lineOverlayChartDataSet.highlightEnabled = false` and if i set this to true the bottom chart will sync with the line but that is not the desired result. I would like the bottom line chart to sync with the upper candlestick chart."},"comment":{"url":"https://api.github.com/repos/danielgindi/Charts/issues/comments/246572859","html_url":"https://github.com/danielgindi/Charts/issues/1424#issuecomment-246572859","issue_url":"https://api.github.com/repos/danielgindi/Charts/issues/1424","id":246572859,"user":{"login":"moon47usaco","id":15712871,"avatar_url":"https://avatars.githubusercontent.com/u/15712871?v=3","gravatar_id":"","url":"https://api.github.com/users/moon47usaco","html_url":"https://github.com/moon47usaco","followers_url":"https://api.github.com/users/moon47usaco/followers","following_url":"https://api.github.com/users/moon47usaco/following{/other_user}","gists_url":"https://api.github.com/users/moon47usaco/gists{/gist_id}","starred_url":"https://api.github.com/users/moon47usaco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/moon47usaco/subscriptions","organizations_url":"https://api.github.com/users/moon47usaco/orgs","repos_url":"https://api.github.com/users/moon47usaco/repos","events_url":"https://api.github.com/users/moon47usaco/events{/privacy}","received_events_url":"https://api.github.com/users/moon47usaco/received_events","type":"User","site_admin":false},"created_at":"2016-09-13T04:49:01Z","updated_at":"2016-09-13T04:49:01Z","body":"I am still a little confused about the highlighter. I currently only have one chart in the combined chart (removed the other for testing) so the index should be 0 correct?\r\n\r\nI tried the fallowing and the bottom line chart is still in sync with the upper combined chart but the highlighter completely disappears from the combined chart with clicks in the lower chart.\r\n\r\n```\r\n    func chartValueSelected(chartView: ChartViewBase, entry: ChartDataEntry, dataSetIndex: Int, highlight: ChartHighlight) {\r\n        if  chartView == combinedChartView {\r\n            lineChartView.highlightValues([highlight])\r\n        }else {\r\n            combinedChartView.highlightValue(xIndex: entry.xIndex, dataSetIndex: 0)\r\n        }\r\n    }\r\n```\r\n\r\nDo I need to write a custom \"chartValueSelected\" function that takes the CombinedChartHighlighter functionality into account.\r\n\r\nThe reason I ask is that when I print out the value of the `highlight: ChartHighlight` when I select the combined chart i get a dataSetIndex of -1 and that is not expected:\r\n\r\n`Highlight, xIndex: 527, dataIndex (combined charts): -1,dataSetIndex: -1, stackIndex (only stacked barentry): -1, value: nan`\r\n\r\nBut for the line chart below i get expected results:\r\n\r\n`Highlight, xIndex: 445, dataIndex (combined charts): 0,dataSetIndex: 0, stackIndex (only stacked barentry): -1, value: 66.684362450327`\r\n"}}
{"actor":{"display_login":"moon47usaco"}}