-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
The ViewPortHandler
Philipp Jahoda edited this page Mar 27, 2016
·
12 revisions
The ViewPortHandler
class is responsible for handling the view-port of the chart. This means it's responsible for what is visible in the chart-view, it's current state in terms of translation and zoom / scale level, the size of the chart and it's drawing area and current offsets. The ViewPortHandler
allows to directly access all the above mentioned properties and modify them.
Getting an instance
An instance of the ViewPortHandler
can be acquired the following way:
ViewPortHandler handler = chart.getViewPortHandler();
Scale & Translation
-
getScaleX()
: Returns the current scale / zoom level on the x-axis. -
getScaleY()
: Returns the current scale / zoom level on the y-axis. -
getTransX()
: Returns the current translation (movement) on the x-axis. -
getTransY()
: Returns the current translation (movement) on the y-axis.
Chart dimensions
-
getContentRect()
: Returns the current content area as aRectF
object.// and many more ...