-
-
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
Chart Selected function is not called on click of every Bar. #2291
Comments
add |
i already did that. The problem is its is been called only for one bar not for all. |
|
Thanks for your reply. I tried this also. But still it is called on that particular one bar only. Please find my code as below: i import UIKit class ViewController: UIViewController, ChartViewDelegate {
} |
add extension yourController: ChartViewDelegate // MARK: - ChartViewDelegate
} |
Yeah i tried that also. But same issue :/ import UIKit // MARK: - ChartViewDelegate
} class ViewController: UIViewController {
override func viewDidLoad() {
// barChart.maxVisibleCount = 60
} func updateChartData(){
} func setDataCount(_ count: Int, range: Double) {
} } Only for one Bar that selected function is called and for rest Notselected function is called. Don't know why?? |
I tried changing the XAxis counts from 7 to 4. But still it will get call on only one bar. |
clean your code |
Tried all points. But still same. Do you want my sample project? So that you can figure it out more. |
for i in 0..<count //).reversed() this is the problem and it is ok func setDataCount(_ count: Int, range: Double)
|
The values of x must be in ascending order |
woahoo.. awesome man..!! It worked.. thanks a lot.. 👍 And can i change the value of Selected Bar. Currently, the values are shown in marker. Cuz i ddnt find anything where i can manipulate selected bar values before it popped up in marker. |
use XYMarkerView.swift and
|
No, actually i don't dates to be on X-Axis. For info, please check my desired output. So, to show Sun- Sat im taking in one array i.e fine: But to show time i have first converting to minutes and then passing as an data into chart.like below:
But once user click on particular Bar, i need to convert above values from minutes to hr-min shows in screenshot. So, for that i have to manipulate data. But i don't see any option for it. |
In may case x values are in ascending order still bar are not tappable. below is the function which returns data. |
|
@danielgindi I have the same issue and found the bug. The bug is in the method in
For example:
To fix the bug, my temporary solution is to custom the
In addition, to make the clicks more accurate, we need to override the method in
|
@Lebron1992 , Man you are a life saver , Thank you very much for the solution. |
@iphone201988 You are welcome! |
@Lebron1992 maaaaaannnnnnnnnnnnnnnnnn, i love you |
I'm using Swift 3.0 charts. And to get click event i'm calling below function:
func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
print(entry.description)
}
But above function is not called on evry Bar i clicked. It is called only on one Bar. When i tried to click on rest of the Bars other than one below function is called.
func chartValueNothingSelected(_ chartView: ChartViewBase) {
print("chartValueNothingSelected")
}
Please suggest me somethng..Thanks in advance..!!
The text was updated successfully, but these errors were encountered: