5.1.1 Data Types

There are 6 data value types available in MCharts. The first 4 are the most frequently used:

Using DataColumnTypes:

1
2
3
4
5
6
7
8
9
10
// Creating data list
ArrayList<Object[]> data = new ArrayList<Object[]>();
 
data.add(new Object[] { "January", new Double(19.5), new Double(8.9) });
data.add(new Object[] { "February", new Double(26.6), new Double(13.3) });
 
// ChartDataModel creation using ColumnTypes
ChartDataModel dataModel = new ChartDataModel(new DataColumnType[] {
   DataColumnType.KEY, DataColumnType.VALUE, DataColumnType.EXTENT },
   list);