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

Marker in CombinedChart is displayed incorrectly. #3404

Closed
StefaniOSApps opened this issue Apr 18, 2018 · 2 comments
Closed

Marker in CombinedChart is displayed incorrectly. #3404

StefaniOSApps opened this issue Apr 18, 2018 · 2 comments

Comments

@StefaniOSApps
Copy link

StefaniOSApps commented Apr 18, 2018

I wrote my own Markter Class. This works fine in LineChart and BarChart. BarChart displays a frame with text above the bar. From this frame a line is painted up to the x-axis. This line is drawn in BarChart above the bars.

If I now use CombinedChart, the line is drawn under the bars. Why? Is this a mistake?

I use the latest pod file.

Cheers
Stefan

@StefaniOSApps
Copy link
Author

StefaniOSApps commented Apr 18, 2018

BarChart - Perfect result - Marker above the bars, the bars stats at x = 0

screen shot 2018-04-18 at 13 22 46

CombinedChart - NOT a Perfect result - Marker under the bars, the bars stats NOT at x = 0

screen shot 2018-04-18 at 23 06 16

@StefaniOSApps
Copy link
Author

StefaniOSApps commented Apr 18, 2018

SOLVED

REPLACE

context.addLine(to: CGPoint(
                x: xValue,
                y: max(rect.origin.y + rect.size.height, (point.y-padding))
                ))

WITH

 context.addLine(to: CGPoint(
                x: xValue,
                y: max(rect.origin.y + rect.size.height, (self.chartView?.frame.size.height)! - (self.chartView?.xAxis.labelHeight)! - (self.chartView?.extraBottomOffset)!)
                ))

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

1 participant