Note that there are some explanatory texts on larger screens.

plurals
  1. POSWTChart mouse event handling
    primarykey
    data
    text
    <p>I have found <a href="http://www.swtchart.org" rel="nofollow noreferrer">SWTChart library</a> and just wonder how it would be possible to select with the mouse a range e.g. 1 to 3 on the x-axis and I would get all y-axis values which belongs to the selected x values.</p> <p><a href="http://www.swtchart.org/screenshots/img/area.png" rel="nofollow noreferrer">a busy cat http://www.swtchart.org/screenshots/img/area.png</a></p> <pre><code>package org.swtchart.examples; import org.eclipse.swt.SWT; import org.eclipse.swt.layout.FillLayout; import org.eclipse.swt.widgets.Composite; import org.eclipse.swt.widgets.Display; import org.eclipse.swt.widgets.Shell; import org.swtchart.Chart; import org.swtchart.ILineSeries; import org.swtchart.ISeries.SeriesType; /** * An example for area chart. */ public class AreaChartExample { private static final double[] ySeries1 = { 0.1, 0.38, 0.71, 0.92, 1.0 }; private static final double[] ySeries2 = { 1.2, 3.53, 3.1, 0.1, 0.5 }; /** * The main method. * * @param args * the arguments */ public static void main(String[] args) { Display display = new Display(); Shell shell = new Shell(display); shell.setText("Area Chart"); shell.setSize(500, 400); shell.setLayout(new FillLayout()); createChart(shell); shell.open(); while (!shell.isDisposed()) { if (!display.readAndDispatch()) { display.sleep(); } } display.dispose(); } /** * create the chart. * * @param parent * The parent composite * @return The created chart */ static public Chart createChart(Composite parent) { // create a chart Chart chart = new Chart(parent, SWT.NONE); // set titles chart.getTitle().setText("Area Chart"); // create line series ILineSeries lineSeries1 = (ILineSeries) chart.getSeriesSet() .createSeries(SeriesType.LINE, "line series 1"); lineSeries1.setYSeries(ySeries1); lineSeries1.setLineColor(Display.getDefault().getSystemColor( SWT.COLOR_RED)); lineSeries1.enableArea(true); ILineSeries lineSeries2 = (ILineSeries) chart.getSeriesSet() .createSeries(SeriesType.LINE, "line series 2"); lineSeries2.setYSeries(ySeries2); lineSeries2.enableArea(true); // adjust the axis range chart.getAxisSet().adjustRange(); return chart; } } </code></pre> <p>How is it possible to include a mouse event for selecting a range in the above example?</p> <p>Thank you in advance.</p>
    singulars
    1. This table or related slice is empty.
    plurals
    1. This table or related slice is empty.
    1. This table or related slice is empty.
    1. This table or related slice is empty.
 

Querying!

 
Guidance

SQuiL has stopped working due to an internal error.

If you are curious you may find further information in the browser console, which is accessible through the devtools (F12).

Reload