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

getMarkerPositionWithHighlight: always return CGPointZero #1728

Closed
kientux opened this issue Oct 27, 2016 · 2 comments
Closed

getMarkerPositionWithHighlight: always return CGPointZero #1728

kientux opened this issue Oct 27, 2016 · 2 comments

Comments

@kientux
Copy link

kientux commented Oct 27, 2016

In Charts v2, I used -getMarkerPositionWithEntry:highlight: to get position of highlight, relative to chart view ( #1399). In v3.0.0, that method is no longer available, and (maybe) it's replaced with -getMarkerPositionWithHighlight:. But it always return CGPointZero. I tried that in sample project:

#pragma mark - ChartViewDelegate

- (void)chartValueSelected:(ChartViewBase * __nonnull)chartView entry:(ChartDataEntry * __nonnull)entry highlight:(ChartHighlight * __nonnull)highlight
{
    CGPoint point = [chartView getMarkerPositionWithHighlight:highlight];
    NSLog(@"%f - %f", point.x, point.y); // Always print 0 - 0
    NSLog(@"chartValueSelected");
}
@kientux
Copy link
Author

kientux commented Oct 27, 2016

Okay, again, after minutes I found out that, I have to get highlight.xPx and highlight.yPx to make CGPoint location of the highlight. But I wonder what's the meaning of that method -getMarkerPositionWithHighlight:, and why it changed so much compare to previous version.

@kientux kientux closed this as completed Oct 27, 2016
@abdulrahman18
Copy link

abdulrahman18 commented Sep 27, 2018

Okay, again, after minutes I found out that, I have to get highlight.xPx and highlight.yPx to make CGPoint location of the highlight. But I wonder what's the meaning of that method -getMarkerPositionWithHighlight:, and why it changed so much compare to previous version.

@kientux I tried highlight.xPx and highlight.yPx it's working for some bar chart. Top position bar only working. Bottom level bars not working for this. I used the horizontal bar chart.

Can you suggest which one is correct?

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

2 participants