Chart Class Reference
Chart.init() Chart.setTitle(title Chart.addColumn(type, label) Chart.setColors(colors) | Chart.addRow(value1, value2, ...) Chart.show(style) |
This class displays line, bar and pie chart. All methods in this class are static. Typically you call a number if Chart.init() and define the columns by calling Chart.addColumn() 2 times. Then call Chart.addRow() to for data row to add. Fianlly call Chart.show() to display the Chart.
Download Pie Chart SampleChart.init()
Inits the Chart. To be call at the beginning of the page
Chart.setTitle(title)
Set the Chart title
Chart.addColumn(type, label)
Defines a colum.
- type (string) can be "string" or "number"
- label (string) is an optional label for the column
Chart.setColors(colors)
Define a custom set of colors for the chart data set
- color (string) contains all colors for the datasets separated by a ;
Chart.setColors(Color.ORANGE + ";" + Color.BLUE); Chart.setColors("#ED6D49;#AC725E");
Chart.addRow(value1, value2, ...)
Adds a row of data to the Chart. The number of types of parameters must match the number of columns defined previously by Chart.addColumn()
Chart.addRowClick(onclick)
Set the function call to execute when the user taps or click on this data row in the chart.
Chart.show(style)
Displays the chart. The style (string) parameter ondicates the chart style.
- style="bar" displays a vertical bar chart
- style="stackbar" displays a vertical stacked bar chart
- style="horizontalbar" displays a horizontal stacked bar chart
- style="line" displays a line chart
- style="pie" displays a pie chart
- style="donut" displays a donut chart