Search in sources :

Example 1 with IErrorBar

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;
}
Also used : IErrorBar(org.eclipse.swtchart.IErrorBar) ISeries(org.eclipse.swtchart.ISeries) Chart(org.eclipse.swtchart.Chart)

Aggregations

Chart (org.eclipse.swtchart.Chart)1 IErrorBar (org.eclipse.swtchart.IErrorBar)1 ISeries (org.eclipse.swtchart.ISeries)1