I have implemented a bar chart and I would like to move to a more specific on click on that bar chart. for that I am using "ChartViewDelegate(Chartviewselected)" it is working fine. but issue is first time when I select bar chart it goes smothly to next screen. but when come back on that screen selected bar shows selected default, when click on that bar again then it gets unselected. because of that chartview delegate(chartview selected) method not called. So I want to disable default selection of bar chart. is there any property to disable selection of bar chart?
可以将文章内容翻译成中文,广告屏蔽插件可能会导致该功能失效(如失效,请关闭广告屏蔽插件后再试):
问题:
回答1:
Use dataSet.highlightEnabled = false
回答2:
When coming back to the screen try calling:
lineview.delegate!.chartValueNothingSelected!(lineview)
According to ChartViewBase.swift:
// Called when nothing has been selected or an "un-select" has been made.
@objc optional func chartValueNothingSelected(_ chartView: ChartViewBase)
回答3:
If you need to removed highlighted Bar while come back from Previous screen put below code in viewWillApper()
it will remove highlighted Bar.
//Manyally Remove Selected Bar
[self.chartView highlightValues:NULL];
Hope this will helps!