-
-
Notifications
You must be signed in to change notification settings - Fork 9.1k
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). Callsinvalidate()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. Callsinvalidate()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 returnViewPortHandlerobject of the chart that contains information about the charts size and bounds (offsets, content-area). -
getRenderer(): Returns the mainDataRendererthat 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 theBitmapobject that represents the chart, thisBitmapalways contains the latest drawing state of the chart. -
setHardwareAccelerationEnabled(boolean enabled): Allows to enable/disable hardware acceleration for the chart, only API level 11+.