use of org.eclipse.swtchart.IErrorBar in project swtchart by eclipse.
the class ErrorBarsExample method createChart.
/**
* create the chart.
*
* @param parent
* The parent composite
* @return The created chart
*/
public static Chart createChart(Composite parent) {
// create a chart
Chart chart = new Chart(parent, SWT.NONE);
chart.getTitle().setText("Error Bars");
// create series
ISeries series = chart.getSeriesSet().createSeries(SeriesType.LINE, "line series");
series.setYSeries(ySeries);
// set error bars
IErrorBar errorBar = series.getYErrorBar();
errorBar.setVisible(true);
errorBar.setError(0.1);
// adjust the axis range
chart.getAxisSet().adjustRange();
return chart;
}