Skip to content
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

如何在滑动代理中获取当前中心位置所对应的数据源的索引 #3318

Closed
MonekyHou opened this issue Mar 7, 2018 · 2 comments

Comments

@MonekyHou
Copy link

  • (void)chartTranslated:(ChartViewBase * _Nonnull)chartView dX:(CGFloat)dX dY:(CGFloat)dY How to get the index of the data source corresponding to the central location in the sliding proxy
@ryanjohndias
Copy link

ryanjohndias commented May 18, 2018

@MonekyHou Not sure if this will help you, but I used something similar to this to highlight the 'middle' point:

func chartTranslated(_ chartView: ChartViewBase, dX: CGFloat, dY: CGFloat) {
    let x = Double(bounds.width/2)
    let selectionPoint = CGPoint(x: x, y: 0)
    let h = getHighlightByTouchPoint(selectionPoint)

    highlightValue(h, callDelegate: true)
}

func chartValueSelected(_ chartView: ChartViewBase, entry: ChartDataEntry, highlight: Highlight) {
    // Here you have access to the entry at the 'middle' point
}

@liuxuan30
Copy link
Member

ask on stack overflow.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants