Mpandroidchart: MarkerView Beyond the (cut off)

Created on 25 Jul 2016  ·  6Comments  ·  Source: PhilJay/MPAndroidChart

Hello, I use the MP, I found MarkerView line graph edges disappear off the screen, as shown in

image

Forgive my English is not good

Most helpful comment

Ok, I've figured it out. It wasn't working because I didn't set the chart instance into my marker view. I think this should be mentioned in MarkerView documentation

All 6 comments

No one has this problem??

In the new release that will be out soon, this problem will no longer be present when extending the MarkerView class. In addition to that, marker positions can be adjusted by overriding the getOffsetForDrawingAtPos(...) method of the IMarker interface.

IMarker documentation.

@PhilJay still not work for the right edge of the LineChart 😕

Ok, I've figured it out. It wasn't working because I didn't set the chart instance into my marker view. I think this should be mentioned in MarkerView documentation

The following URL can give you a reference:
https://www.jianshu.com/p/ca0246f5f1fb

as @alexkrolinfinum mentioned it's required to do [kotlin]:
val marker = YourMarkerView(chart.context, R.layout.chart_hint).apply { chartView = chart }

the relevant part: .apply { chartView = chart }. When doing this, the lib will actually protect the visibility of your hint MarkerView.

Guys please add to docs, 2h behind this here :(

Was this page helpful?
0 / 5 - 0 ratings

Related issues

botondbutuza picture botondbutuza  ·  3Comments

DarkHelmet67 picture DarkHelmet67  ·  3Comments

vishvendu picture vishvendu  ·  3Comments

tsengvn picture tsengvn  ·  3Comments

Giammaofwar picture Giammaofwar  ·  3Comments