Search in sources :

Example 1 with XYMultipleSeriesDataset

use of com.codename1.charts.models.XYMultipleSeriesDataset in project CodenameOne by codenameone.

the class XYMultiSeriesTransition method getBuffer.

/**
 * Gets the buffer/cache for values.  Values set in the buffer will be applied
 * to the target dataset when the transition takes place.
 * @return
 */
public XYMultipleSeriesDataset getBuffer() {
    if (datasetCache == null) {
        datasetCache = new XYMultipleSeriesDataset();
        for (int i = 0; i < dataset.getSeriesCount(); i++) {
            datasetCache.addSeries(new XYSeries(dataset.getSeriesAt(i).getTitle()));
        }
        seriesTransitions = new XYSeriesTransition[dataset.getSeries().length];
        int tlen = seriesTransitions.length;
        for (int i = 0; i < tlen; i++) {
            seriesTransitions[i] = new XYSeriesTransition(getChart(), dataset.getSeriesAt(i));
            seriesTransitions[i].setBuffer(datasetCache.getSeriesAt(i));
        }
    }
    return datasetCache;
}
Also used : XYSeries(com.codename1.charts.models.XYSeries) XYMultipleSeriesDataset(com.codename1.charts.models.XYMultipleSeriesDataset)

Aggregations

XYMultipleSeriesDataset (com.codename1.charts.models.XYMultipleSeriesDataset)1 XYSeries (com.codename1.charts.models.XYSeries)1