public abstract class ChartPopupBehavior extends ChartBehavior implements TooltipAdapter
Constructor and Description |
---|
ChartPopupBehavior(Context context)
Creates an instance of
ChartPopupBehavior . |
Modifier and Type | Method and Description |
---|---|
boolean |
alignTooltipVertically()
States whether the tooltip should be placed vertically or horizontally to the currently selected target.
|
RectF |
availableLayoutSlot()
Gets the layout slot in which the popup will be arranged.
|
boolean |
close()
Closes the popup if needed.
|
ChartDataContext |
extractTooltipContext(DataPoint point)
Extracts data context for a given data point using a
ValueExtractor |
ChartDataContext |
extractTooltipContext(Point location)
Extracts context data for a given location.
|
boolean |
getApplyDefaultStyles()
Gets a value determining whether to apply the default styles or not.
|
TooltipContextNeededListener |
getContextNeededListener()
Gets the current listener responsible for providing context to the tooltip.
|
ChartDataContext |
getLastChartContext()
Gets the previous chart data context if there is one.
|
float |
getMaxTouchDistanceTolerance()
Gets the max touch target distance of the behavior.
|
RadRect |
getPlotAreaClip()
Gets the clip of the current plot area.
|
TooltipPresenterBase |
getPopupPresenter()
Gets the presenter that renders this behavior.
|
Object[] |
getTooltipData(Object context)
Gets the data for the tooltip using the passed context.
|
boolean |
isTooltipDisplayed()
Gets a value stating whether the tooltip is currently being displayed.
|
boolean |
open(DataPoint dataPoint)
Attempts to open the popup and returns a boolean stating the result of this attempt.
|
boolean |
open(Point location,
Point rawLocation)
Attempts to open the popup and returns a boolean stating the result of this attempt.
|
Point |
rawOffset()
The offset from the touch event according to the current target view instance and the world coordinates of the same touch event.
|
void |
setApplyDefaultStyles(boolean applyDefaultStyles)
Sets a value determining whether to apply the default styles or not.
|
void |
setMaxTouchDistanceTolerance(float value)
Gets the max touch target distance of the behavior.
|
void |
setPopupPresenter(TooltipPresenterBase popupPresenter)
Sets the presenter that renders this behavior.
|
void |
setTooltipContextNeededListener(TooltipContextNeededListener listener)
Sets the current listener responsible for providing context to the tooltip.
|
attach, chart, detach, onDoubleTap, onDown, onDrag, onHold, onPinch, onPinchComplete, onTap, onUp, reset
getValue, resetPropertyValue, setValue, setValue
equals, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
contentAdapter, setContentAdapter
public ChartPopupBehavior(Context context)
ChartPopupBehavior
.context
- The app context.public RectF availableLayoutSlot()
availableLayoutSlot
in interface TooltipAdapter
public boolean alignTooltipVertically()
TooltipAdapter
alignTooltipVertically
in interface TooltipAdapter
true
to place it above or bellow with above being the first choice, false
to place it left or right with right being the first choice.public ChartDataContext getLastChartContext()
public float getMaxTouchDistanceTolerance()
public void setMaxTouchDistanceTolerance(float value)
value
- The new max touch distance.public TooltipPresenterBase getPopupPresenter()
public void setPopupPresenter(TooltipPresenterBase popupPresenter)
popupPresenter
- The new popup presenter.public boolean isTooltipDisplayed()
true
if the tooltip is visible, false
otherwise.public TooltipContextNeededListener getContextNeededListener()
public void setTooltipContextNeededListener(TooltipContextNeededListener listener)
listener
- the new listener.public Point rawOffset()
TooltipAdapter
rawOffset
in interface TooltipAdapter
public Object[] getTooltipData(Object context)
TooltipAdapter
getTooltipData
in interface TooltipAdapter
context
- context used to extract the data for the current tooltip.public boolean open(Point location, Point rawLocation)
location
- the location at which the gesture was recorded.rawLocation
- the location of the gesture in world coordinates.true
if the open attempt was successful, false
otherwise.public boolean open(DataPoint dataPoint)
dataPoint
- the data point for which the tooltip will be opened.true
if the open attempt was successful, false
otherwise.public ChartDataContext extractTooltipContext(Point location)
location
- the location for which data context will be extracted.public ChartDataContext extractTooltipContext(DataPoint point)
ValueExtractor
point
- the data point from which data will be extracted.public RadRect getPlotAreaClip()
TooltipAdapter
getPlotAreaClip
in interface TooltipAdapter
public boolean close()
public boolean getApplyDefaultStyles()
true
will result in application of the default styles, false
will prevent it.public void setApplyDefaultStyles(boolean applyDefaultStyles)
applyDefaultStyles
- the value.