This chapter describes how to retrieve data from sources such as Text, XML files, databases or even class objects and store it in DataModel object, in order to use it for drawing charts.
Setting DataBinding object:
DataBinding db = new DataBinding(); |
There are 5 predefined types of data which can be used when setting dataBinding object:
Adding mappings to DataBinding object in case there is a text file with double values:
1 | //sets column value as double object db.addMapping(null, ColumnType.DOUBLE); //sets column value as double object db.addMapping(null, ColumnType.DOUBLE); |
Adding mappings to DataBinding object in case there is a text file with double values, where first line is used as columns names:
1 | //sets column name "double1", and its value as double object db.addMapping("double1", ColumnType.DOUBLE); //sets column name "double2", and its value as double object db.addMapping("double5", ColumnType.DOUBLE); |
Adding mapping to DataBinding object in case there is a data column type: any undefined or taken column name is replaced with first found unused columns name.
//sets data column type db.addMapping("double4", ColumnType.DOUBLE, DataColumnType.EXTRA); |