public class ChartTrackBallBehavior extends ChartPopupBehavior
RadChartViewBase
's
render surface. The two lines intersect at the center of the closest data point found.Modifier and Type | Field and Description |
---|---|
static int |
BACKGROUND_PROPERTY_KEY |
static int |
CATEGORY_COLOR_PROPERTY_KEY |
static int |
CATEGORY_SIZE_PROPERTY_KEY |
static int |
PADDING_PROPERTY_KEY |
static int |
VALUE_COLOR_PROPERTY_KEY |
static int |
VALUE_SIZE_PROPERTY_KEY |
Constructor and Description |
---|
ChartTrackBallBehavior(Context context)
Initializes a new instance of the
ChartTrackBallBehavior class. |
Modifier and Type | Method and Description |
---|---|
TooltipContentAdapter |
contentAdapter()
Provides a content adapter for the current tooltip instance.
|
int |
getBackgroundColor() |
int |
getCategoryTextColor() |
float |
getCategoryTextSize() |
ChartTrackballContentAdapter.ChartTrackBallContentProvider |
getCustomContentProvider()
Gets an implementation of the
ChartTrackballContentAdapter.ChartTrackBallContentProvider interface used to
retrieve a custom content for the trackball for a given DataPoint . |
int |
getPadding() |
TrackBallHitTestMode |
getPointHitTestMode()
Gets a value determining whether visual information for all the closest data points will be displayed.
|
List<DataPoint> |
getRelatedDataPoints()
Gets a list of data points related to the currently tracked one.
|
boolean |
getShowIntersectionPoints()
Gets a value determining whether visual information for all the closest data points will be displayed.
|
boolean |
getShowTrackInfo()
Gets a value determining whether visual information for all the closest data points will be displayed.
|
TrackBallSnapMode |
getSnapMode()
Gets a value determining how the track ball behaviour will snap to the data points closest to a physical lastLocation.
|
Object[] |
getTooltipData(Object context)
Gets the data for the tooltip using the passed context.
|
int |
getValueTextColor() |
float |
getValueTextSize() |
boolean |
onDrag(MotionEvent event,
MotionEvent event2,
RadSize distance,
boolean isInHold)
Invoked when a drag gesture occurs on the owner chart.
|
boolean |
onHold(MotionEvent e)
Invoked when a hold gesture occurs on the owner chart.
|
boolean |
onUp(MotionEvent e)
Invoked when the user lifts a finger from the chart.
|
void |
setBackgroundColor(int color) |
void |
setCategoryTextColor(int value) |
void |
setCategoryTextSize(float value) |
void |
setContentAdapter(TooltipContentAdapter adapter) |
void |
setCustomContentProvider(ChartTrackballContentAdapter.ChartTrackBallContentProvider provider)
Sets an implementation of the
ChartTrackballContentAdapter.ChartTrackBallContentProvider interface used to
retrieve a custom content for the trackball for a given DataPoint . |
void |
setPadding(int value) |
void |
setPointHitTestMode(TrackBallHitTestMode value)
Sets a value determining whether visual information for all the closest data points will be displayed.
|
void |
setShowIntersectionPoints(boolean value)
Sets a value determining whether visual information for all the closest data points will be displayed.
|
void |
setShowTrackInfo(boolean value)
Sets a value determining whether visual information for all the closest data points will be displayed.
|
void |
setSnapMode(TrackBallSnapMode mode)
Sets a value determining how the track ball behaviour will snap to the data points closest to a physical lastLocation.
|
void |
setValueTextColor(int color) |
void |
setValueTextSize(float value) |
alignTooltipVertically, availableLayoutSlot, close, extractTooltipContext, extractTooltipContext, getApplyDefaultStyles, getContextNeededListener, getLastChartContext, getMaxTouchDistanceTolerance, getPlotAreaClip, getPopupPresenter, isTooltipDisplayed, open, open, rawOffset, setApplyDefaultStyles, setMaxTouchDistanceTolerance, setPopupPresenter, setTooltipContextNeededListener
attach, chart, detach, onDoubleTap, onDown, onPinch, onPinchComplete, onTap, reset
getValue, resetPropertyValue, setValue, setValue
public static final int BACKGROUND_PROPERTY_KEY
public static final int PADDING_PROPERTY_KEY
public static final int CATEGORY_COLOR_PROPERTY_KEY
public static final int VALUE_COLOR_PROPERTY_KEY
public static final int CATEGORY_SIZE_PROPERTY_KEY
public static final int VALUE_SIZE_PROPERTY_KEY
public ChartTrackBallBehavior(Context context)
ChartTrackBallBehavior
class.public int getBackgroundColor()
public void setBackgroundColor(int color)
public int getPadding()
public void setPadding(int value)
public int getCategoryTextColor()
public void setCategoryTextColor(int value)
public float getCategoryTextSize()
public void setCategoryTextSize(float value)
public float getValueTextSize()
public void setValueTextSize(float value)
public int getValueTextColor()
public void setValueTextColor(int color)
public ChartTrackballContentAdapter.ChartTrackBallContentProvider getCustomContentProvider()
ChartTrackballContentAdapter.ChartTrackBallContentProvider
interface used to
retrieve a custom content for the trackball for a given DataPoint
.ChartTrackballContentAdapter.ChartTrackBallContentProvider
implementation that is currently set.public void setCustomContentProvider(ChartTrackballContentAdapter.ChartTrackBallContentProvider provider)
ChartTrackballContentAdapter.ChartTrackBallContentProvider
interface used to
retrieve a custom content for the trackball for a given DataPoint
.provider
- the ChartTrackballContentAdapter.ChartTrackBallContentProvider
implementation to set.public boolean getShowTrackInfo()
true
if visual information will be displayed, false
otherwise.public void setShowTrackInfo(boolean value)
value
- the new value.public boolean getShowIntersectionPoints()
true
if the information will be displayed, false
otherwise.public void setShowIntersectionPoints(boolean value)
value
- the new value.public TrackBallHitTestMode getPointHitTestMode()
true
if the information will be displayed, false
otherwise.public void setPointHitTestMode(TrackBallHitTestMode value)
value
- the new value.public List<DataPoint> getRelatedDataPoints()
public TrackBallSnapMode getSnapMode()
public void setSnapMode(TrackBallSnapMode mode)
mode
- the new snap mode.public TooltipContentAdapter contentAdapter()
TooltipAdapter
TooltipContentAdapter
public void setContentAdapter(TooltipContentAdapter adapter)
public boolean onHold(MotionEvent e)
ChartBehavior
onHold
in class ChartBehavior
e
- An object that contains gesture information.public boolean onDrag(MotionEvent event, MotionEvent event2, RadSize distance, boolean isInHold)
ChartBehavior
onDrag
in class ChartBehavior
event
- Information for the event that started the gesture.event2
- Information for the event that caused the current drag gesturedistance
- The distance travelled since the previous gesture. This is NOT the distance between initialEvent and currentEvent.public boolean onUp(MotionEvent e)
ChartBehavior
onUp
in class ChartBehavior
e
- An object that contains gesture information.public Object[] getTooltipData(Object context)
TooltipAdapter
getTooltipData
in interface TooltipAdapter
getTooltipData
in class ChartPopupBehavior
context
- context used to extract the data for the current tooltip.