Search in sources :

Example 1 with XYChart

use of com.twosigma.beakerx.chart.xychart.XYChart in project beakerx by twosigma.

the class ChartDetails method getGraphics.

/**
 * Taken from code{@code com.twosigma.beaker.groovy.rest.ChartRest#getGraphics}
 *
 * @param info  GraphicsActionObject
 * @param chart ChartDetails
 * @return list of Graphics for given plot data
 */
protected List<? extends Graphics> getGraphics(GraphicsActionObject info, ChartDetails chart) {
    List<? extends Graphics> graphics = null;
    if (chart instanceof XYChart) {
        graphics = ((XYChart) chart).getGraphics();
    } else if (chart instanceof CategoryPlot) {
        graphics = ((CategoryPlot) chart).getGraphics();
    } else if (chart instanceof CombinedPlot) {
        XYChart subplot = ((CombinedPlot) chart).getSubplots().get(((CombinedPlotActionObject) info).getSubplotIndex());
        graphics = subplot.getGraphics();
    }
    return graphics;
}
Also used : XYChart(com.twosigma.beakerx.chart.xychart.XYChart) CategoryPlot(com.twosigma.beakerx.chart.categoryplot.CategoryPlot) CombinedPlot(com.twosigma.beakerx.chart.xychart.CombinedPlot)

Aggregations

CategoryPlot (com.twosigma.beakerx.chart.categoryplot.CategoryPlot)1 CombinedPlot (com.twosigma.beakerx.chart.xychart.CombinedPlot)1 XYChart (com.twosigma.beakerx.chart.xychart.XYChart)1