use of org.eclipse.swtchart.ILineSeries in project netxms by netxms.
the class LineChart method addLineSeries.
/**
* Add line series to chart
*
* @param description Description
* @param xSeries X axis data
* @param ySeries Y axis data
*/
@SuppressWarnings("deprecation")
private ILineSeries<?> addLineSeries(int index, String description, Date[] xSeries, double[] ySeries) {
ISeriesSet seriesSet = getSeriesSet();
ILineSeries<?> series = (ILineSeries<?>) seriesSet.createSeries(SeriesType.LINE, Integer.toString(index));
series.setDescription(description);
series.setSymbolType(PlotSymbolType.NONE);
series.setLineWidth(configuration.getLineWidth());
series.setLineColor(getColorFromPreferences("Chart.Colors.Data." + index));
series.setXDateSeries(xSeries);
series.setYSeries(ySeries);
try {
series.enableStack(configuration.isStacked());
} catch (IllegalStateException e) {
logger.error("Exception while adding chart series", e);
}
return series;
}
use of org.eclipse.swtchart.ILineSeries in project org.eclipse.linuxtools by eclipse-linuxtools.
the class ScatterChartBuilder method createChartISeries.
@Override
protected ISeries createChartISeries(int i) {
ILineSeries series = (ILineSeries) super.createChartISeries(i);
series.setSymbolColor(COLORS[i % COLORS.length]);
series.setLineStyle(LineStyle.NONE);
return series;
}
use of org.eclipse.swtchart.ILineSeries in project org.eclipse.linuxtools by eclipse-linuxtools.
the class AreaChartBuilder method createChartISeries.
@Override
protected ISeries createChartISeries(int i) {
ILineSeries series = (ILineSeries) super.createChartISeries(i);
series.enableArea(true);
return series;
}
use of org.eclipse.swtchart.ILineSeries in project org.eclipse.linuxtools by eclipse-linuxtools.
the class LineChartBuilder method createChartISeries.
@Override
protected ISeries createChartISeries(int i) {
ILineSeries series = (ILineSeries) chart.getSeriesSet().createSeries(SeriesType.LINE, adapter.getLabels()[i + 1]);
series.setSymbolColor(COLORS[i % COLORS.length]);
series.setLineColor(COLORS[i % COLORS.length]);
series.setLineStyle(LineStyle.SOLID);
return series;
}
use of org.eclipse.swtchart.ILineSeries in project swtchart by eclipse.
the class PlotArea method paintControl.
/*
* @see PaintListener#paintControl(PaintEvent)
*/
public void paintControl(PaintEvent e) {
Point p = getSize();
GC gc = e.gc;
// draw the plot area background
Color oldBackground = gc.getBackground();
gc.setBackground(getBackground());
gc.fillRectangle(0, 0, p.x, p.y);
// draw grid
for (IAxis axis : chart.getAxisSet().getAxes()) {
((Grid) axis.getGrid()).draw(gc, p.x, p.y);
}
// draw behind series
for (ICustomPaintListener listener : paintListeners) {
if (listener.drawBehindSeries()) {
listener.paintControl(e);
}
}
// draw series. The line series should be drawn on bar series.
for (ISeries series : chart.getSeriesSet().getSeries()) {
if (series instanceof IBarSeries) {
((Series) series).draw(gc, p.x, p.y);
}
}
for (ISeries series : chart.getSeriesSet().getSeries()) {
if (series instanceof ILineSeries) {
((Series) series).draw(gc, p.x, p.y);
}
}
// draw over series
for (ICustomPaintListener listener : paintListeners) {
if (!listener.drawBehindSeries()) {
listener.paintControl(e);
}
}
e.gc.setBackground(oldBackground);
}
Aggregations