Skip to content

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 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();

Properties

  • getScaleX(): Returns the current scale / zoom level on the x-axis.
  • getScaleY(): Returns the current scale / zoom level on the y-axis.
  • getTranslationX(): Returns the current translation (movement) on the x-axis.
  • getTranslationY(): Returns the current translation (movement) on the y-axis.

Clone this wiki locally