use of org.eclipse.swtchart.ISeries 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.");
}
}
use of org.eclipse.swtchart.ISeries in project swtchart by eclipse.
the class AbstractExtendedChart method appendSeries.
@Override
public void appendSeries(ISeriesData seriesData) {
if (seriesData != null) {
ISeriesSet seriesSet = getSeriesSet();
ISeries series = seriesSet.getSeries(seriesData.getId());
if (series != null) {
/*
* Append the data.
*/
double[] xSeriesNew = concatenateSeries(series.getXSeries(), seriesData.getXSeries());
series.setXSeries(xSeriesNew);
double[] ySeriesNew = concatenateSeries(series.getYSeries(), seriesData.getYSeries());
series.setYSeries(ySeriesNew);
//
calculateCoordinates(series);
}
}
}
use of org.eclipse.swtchart.ISeries in project swtchart by eclipse.
the class BaseChart method showSeries.
public void showSeries(String selectedSeriesId) {
ISeries dataSeries = getSeriesSet().getSeries(selectedSeriesId);
if (dataSeries != null) {
dataSeries.setVisible(true);
dataSeries.setVisibleInLegend(true);
}
}
use of org.eclipse.swtchart.ISeries in project swtchart by eclipse.
the class BaseChart method hideSeries.
public void hideSeries(String selectedSeriesId, boolean fireUpdate) {
ISeries dataSeries = getSeriesSet().getSeries(selectedSeriesId);
if (dataSeries != null) {
selectedSeriesIds.remove(selectedSeriesId);
dataSeries.setVisible(false);
dataSeries.setVisibleInLegend(false);
if (fireUpdate) {
fireSeriesStatusEvent(selectedSeriesId, ISeriesStatusListener.HIDE);
}
}
}
use of org.eclipse.swtchart.ISeries in project swtchart by eclipse.
the class BaseChart method createSeries.
@Override
public ISeries createSeries(ISeriesData seriesData, ISeriesSettings seriesSettings) throws SeriesException {
ISeries series = super.createSeries(seriesData, seriesSettings);
calculateRedrawFrequency();
return series;
}
Aggregations