-
- All Implemented Interfaces:
-
com.github.mikephil.charting.components.IMarker
public class MarkerImage implements IMarker
View that can be displayed when selecting values in the chart. Extend this class to provide custom layouts for your markers.
-
-
Constructor Summary
Constructors Constructor Description MarkerImage(Context context, int drawableResourceId)Constructor.
-
Method Summary
Modifier and Type Method Description voidsetOffset(MPPointF offset)voidsetOffset(float offsetX, float offsetY)MPPointFgetOffset()voidsetSize(FSize size)FSizegetSize()voidsetChartView(Chart chart)ChartgetChartView()MPPointFgetOffsetForDrawingAtPoint(float posX, float posY)voidrefreshContent(Entry e, Highlight highlight)This method enables a specified custom IMarker to update it's content every time the IMarker is redrawn. voiddraw(Canvas canvas, float posX, float posY)Draws the IMarker on the given position on the screen with the given Canvas object. -
-
Constructor Detail
-
MarkerImage
MarkerImage(Context context, int drawableResourceId)
Constructor.- Parameters:
drawableResourceId- the drawable resource to render
-
-
Method Detail
-
setOffset
void setOffset(float offsetX, float offsetY)
-
setChartView
void setChartView(Chart chart)
-
getChartView
Chart getChartView()
-
getOffsetForDrawingAtPoint
MPPointF getOffsetForDrawingAtPoint(float posX, float posY)
- Parameters:
posX- This is the X position at which the marker wants to be drawn.You can adjust the offset conditionally based on this argument.posY- This is the X position at which the marker wants to be drawn.You can adjust the offset conditionally based on this argument.
-
refreshContent
void refreshContent(Entry e, Highlight highlight)
This method enables a specified custom IMarker to update it's content every time the IMarker is redrawn.
- Parameters:
e- The Entry the IMarker belongs to.highlight- The highlight object contains information about the highlighted value such as it's dataset-index, theselected range or stack-index (only stacked bar entries).
-
-
-
-