-
-
Notifications
You must be signed in to change notification settings - Fork 6k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
CombinedChartView line + bar #353
Comments
Could you make a screenshot maybe? I don't quite get what you mean with 'bars are cut in half'. |
Yes. First and last bars are half in width than others. It doesn't look good. The demo that is provided, has full bars, with line points at center of those bars. I would love a chart that is shown on readme.md (Combined-Chart (bar- and linechart in this case). What am I missing to get that view? Because of this, point values are overlapping with yAxis values. |
I am encountering another bug in which if I tap on a bar which has line circle drawn within it e.g March, it always shows value of line in chartValueSelected and not of bar. Whereas on bar where circle is outside e.g. Sep, it works well. |
For all circles with bar, hit area seems to be too much! |
@vigyanhoon , the half bar issue should be fixed in #324. Could you check on your side? About the other bug, could you be more specific? |
I think its not fixed for line + bar but for bubble + bar. override func calcMinMax()
|
There are two issues which are even reproducible in the chartDemo given in source:
|
@vigyanhoon , your pasted code is before fix, not after. check out #323. Should be the same problem? It's for line+bar without bubble. |
For the second issue, I am still confused, what you mean by only line value will be selected? I tried, it will highlight the bar and bubble, and draw a cross line on the line dot. Seems fine. |
Now I am confused! I still see exact same lines as pasted by me at https://github.com/danielgindi/ios-charts/blob/swift-2.0/Charts/Classes/Charts/CombinedChartView.swift |
I will explain the second issue again. See following chart plotted in demo project. If I tap Jun bar, above 50% of bar height, it selects bar only. But below that, it will only print line value in (void)chartValueSelected: delegate, that means its only selecting line after a certain point. Ideally it should select line only when I tap on any of the line circles, but no portion of bar should allow selection of line or any other graph type. |
For the half bar issue, you are on swift-2.0 branch, which does not merged from master for a while. That's why you see old code. |
For the second issue, are you saying when you tap the top part of the Jun bar, the bar, line, bubble are not getting highligted sometimes? On my side, when I tap the higher part of the bar, sometimes the highlight is not working, but when you tap the lower part, it almost highlight every time. For what you want, it seems like a customization, you could do whatever you like when highlighting. The ChartsDemo just write simple effect. You need to override those methods to get your effect. |
Its not a customization. (void)chartValueSelected: delegate should return the source of interaction correctly. For top bar its perfect as it returns bar, but for bottom part it always returns line. Thats incorrect. Even at bottom part of bar, it should return bar when tapped on bar, and line only when tapped on line circle. But it always return 0 as dataset index when tapping on bottom bar in (void)chartValueSelected. Thats how its with all other chart libraries e.g. http://www.highcharts.com/demo/combo |
I am using an empty instance to make bars proper for now. Can you please let me know when the changes will be pushed to swift branch? |
You can ask @danielgindi. Giving the iOS 9 is releasing on 9.16, it should be soon? |
Closing, it should be resolved now, swift 2.0 has merged into master. |
I still have the cutting bars problem today |
Any updates on the issue? I am still facing the issue. Please refer the code and output screenshot below. private func setupChart() {
|
I can just concur with @ratka6 and @nitinvsingh. I just updated to |
@arorajatin's workaround works for me (from #323) |
Hi,
I am trying to plot a graph in Swift2.0 with bar and line. However first and last bars on graph are cut in half. Also I don't get tap highlight for bars. Only bars on which line point is drawn within, accepts highlight. Can you please let me know whats wrong here?
My code
@IBOutlet weak var dayChart: CombinedChartView!
The text was updated successfully, but these errors were encountered: