-
-
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
Multiple Highlight points #4430
Comments
Hello @llKoull override func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
super.chartValueSelected(chartView, entry: entry, highlight: highlight)
var secondSetIndex: Int
if highlight.dataSetIndex == 0
{
secondSetIndex = 2 //the second (index == 1) set is red, the selection is not visible enough
}
else
{
secondSetIndex = 0
}
let secondHighlight = Highlight(x: highlight.x, y: highlight.y, dataSetIndex: secondSetIndex, dataIndex: highlight.dataIndex)
chartView.highlightValues([highlight, secondHighlight])
self.chartView.centerViewToAnimated(xValue: entry.x, yValue: entry.y,
axis: self.chartView.data!.getDataSetByIndex(highlight.dataSetIndex).axisDependency,
duration: 1)
//[_chartView moveViewToAnimatedWithXValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0];
//[_chartView zoomAndCenterViewAnimatedWithScaleX:1.8 scaleY:1.8 xValue:entry.x yValue:entry.y axis:[_chartView.data getDataSetByIndex:dataSetIndex].axisDependency duration:1.0];
} |
Hello @bivant ! Thanks for your quick answer i didn't see the method highlightValues!! I'm using it now and it's working perfectly. Best regards, |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Hi!
I'm using this awesome library to represent 2 line charts using the same LineChartView.
Is it possible to show the highlight point simultaneously in both lines? It does not mind me if the highlight points are going to be in the same X value at the same time or not (the X values are the same for both lines).
Thanks and best regards,
The text was updated successfully, but these errors were encountered: