Search in sources :

Example 1 with SeriesType

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.");
    }
}
Also used : ISeriesSet(org.eclipse.swtchart.ISeriesSet) SeriesType(org.eclipse.swtchart.ISeries.SeriesType) SeriesException(org.eclipse.swtchart.extensions.exceptions.SeriesException) ISeries(org.eclipse.swtchart.ISeries)

Aggregations

ISeries (org.eclipse.swtchart.ISeries)1 SeriesType (org.eclipse.swtchart.ISeries.SeriesType)1 ISeriesSet (org.eclipse.swtchart.ISeriesSet)1 SeriesException (org.eclipse.swtchart.extensions.exceptions.SeriesException)1