Skip to content

Miscellaneous

Philipp Jahoda edited this page Mar 29, 2015 · 9 revisions

Chart content

  • clear(): Clears the chart of all data (by setting the data object to null). Calls invalidate() to refresh the chart.
  • clearValues(): Clears the chart of all DataSet objects and thereby all Entries. Does not remove the provided x-values from the chart. Calls invalidate() to refresh the chart.
  • isEmpty(): Will return true if the charts data object is null, or if it contains no entries.

Useful getter methods

  • getData(): Will return the data object you set for the chart.
  • getViewPortHandler(): Will return ViewPortHandler object of the chart that contains information about the charts size and bounds (offsets, content-area).
  • getRenderer(): Returns the main DataRenderer that is responsible for drawing the chart data.
  • getCenter(): Returns the center point of the whole chart-view.
  • getCenterOffsets(): Returns the center point of the chart drawing-area.
  • getAverage(): Returns the average value across all values the chart holds.
  • getPercentOfTotal(float value): Returns the percentage the provided value makes up of the total value-sum inside the chart.
  • getValueCount(): Returns the total number of values the chart holds.
  • getValueSum(): Returns the sum of all values inside the chart.
  • getYMin(): Returns lowest value the chart holds.
  • getYMax(): Returns biggest value the chart holds.

Some more methods (of the Chart class)

  • saveToGallery(String title): Saves the current chart state as an image to the gallery.
  • saveToPath(String title, String pathOnSD): Saves the current chart state as an image to the specified path.
  • getChartBitmap(): Returns the Bitmap object that represents the chart, this Bitmap always contains the latest drawing state of the chart.
  • setHardwareAccelerationEnabled(boolean enabled): Allows to enable/disable hardware acceleration for the chart, only API level 11+.

The documentation has moved.

Clone this wiki locally