use of org.eclipse.swtchart.ISeries.SeriesType in project swtchart by eclipse.
the class AbstractExtendedChart method createSeries.
@Override
public ISeries createSeries(ISeriesData seriesData, ISeriesSettings seriesSettings) throws SeriesException {
SeriesType seriesType = getSeriesType(seriesSettings);
double[] xSeries = seriesData.getXSeries();
double[] ySeries = seriesData.getYSeries();
//
if (xSeries.length == ySeries.length) {
/*
* Put the settings to the map.
*/
String id = seriesData.getId();
seriesSettingsMap.put(id, seriesSettings);
//
ISeriesSet seriesSet = getSeriesSet();
ISeries series = seriesSet.createSeries(seriesType, id);
series.setXSeries(xSeries);
series.setYSeries(ySeries);
calculateCoordinates(series);
return series;
} else {
throw new SeriesException("The length of x and y series differs.");
}
}
Aggregations