Search in sources :

Example 1 with Area

use of com.twosigma.beakerx.chart.xychart.plotitem.Area in project beakerx by twosigma.

the class GroovyEvaluatorChartTest method parsePlotWithAreaScript_returnPlotObjectWithArea.

@Test
public void parsePlotWithAreaScript_returnPlotObjectWithArea() {
    // when
    Object result = parseClassFromScript("def plot = new Plot()\n" + "def ys = [3, 5, 2, 3]\n" + "def xs = [0, 1, 2, 3]\n" + "plot << new Area(x: xs, y: ys)");
    // then
    Assertions.assertThat(result instanceof Plot).isTrue();
    Plot plot = (Plot) result;
    Assertions.assertThat(plot.getGraphics()).isNotEmpty();
    Assertions.assertThat(plot.getGraphics().get(0) instanceof Area).isTrue();
}
Also used : Area(com.twosigma.beakerx.chart.xychart.plotitem.Area) TimePlot(com.twosigma.beakerx.chart.xychart.TimePlot) SimpleTimePlot(com.twosigma.beakerx.chart.xychart.SimpleTimePlot) CombinedPlot(com.twosigma.beakerx.chart.xychart.CombinedPlot) Plot(com.twosigma.beakerx.chart.xychart.Plot) CategoryPlot(com.twosigma.beakerx.chart.categoryplot.CategoryPlot) NanoPlot(com.twosigma.beakerx.chart.xychart.NanoPlot) Test(org.junit.Test)

Example 2 with Area

use of com.twosigma.beakerx.chart.xychart.plotitem.Area in project beakerx by twosigma.

the class BasedXYGraphicsSerializerTest method initTestStubData.

@Before
public void initTestStubData() throws IOException {
    sw = new StringWriter();
    jgen = mapper.getJsonFactory().createJsonGenerator(sw);
    area = new Area();
    area.setX(Arrays.asList(1, 2, 3));
    area.setY(Arrays.asList(1, 2, 3));
}
Also used : Area(com.twosigma.beakerx.chart.xychart.plotitem.Area) StringWriter(java.io.StringWriter) Before(org.junit.Before)

Example 3 with Area

use of com.twosigma.beakerx.chart.xychart.plotitem.Area in project beakerx by twosigma.

the class PlotTest method initStubData.

@Before
public void initStubData() {
    plot = new Plot();
    line = new Line();
    line.setX(Arrays.asList(1, 2, 3));
    line.setY(Arrays.asList(2, 3, 4));
    area = new Area();
    area.setX(Arrays.asList(1, 2, 3));
    area.setY(Arrays.asList(2, 3, 4));
}
Also used : Line(com.twosigma.beakerx.chart.xychart.plotitem.Line) ConstantLine(com.twosigma.beakerx.chart.xychart.plotitem.ConstantLine) Area(com.twosigma.beakerx.chart.xychart.plotitem.Area) Before(org.junit.Before)

Example 4 with Area

use of com.twosigma.beakerx.chart.xychart.plotitem.Area in project beakerx by twosigma.

the class AreaSerializerTest method initTestStubData.

@Before
public void initTestStubData() throws IOException {
    sw = new StringWriter();
    jgen = mapper.getJsonFactory().createJsonGenerator(sw);
    area = new Area();
    area.setX(Arrays.asList(1, 2, 3));
    area.setY(Arrays.asList(1, 2, 3));
}
Also used : Area(com.twosigma.beakerx.chart.xychart.plotitem.Area) StringWriter(java.io.StringWriter) Before(org.junit.Before)

Aggregations

Area (com.twosigma.beakerx.chart.xychart.plotitem.Area)4 Before (org.junit.Before)3 StringWriter (java.io.StringWriter)2 CategoryPlot (com.twosigma.beakerx.chart.categoryplot.CategoryPlot)1 CombinedPlot (com.twosigma.beakerx.chart.xychart.CombinedPlot)1 NanoPlot (com.twosigma.beakerx.chart.xychart.NanoPlot)1 Plot (com.twosigma.beakerx.chart.xychart.Plot)1 SimpleTimePlot (com.twosigma.beakerx.chart.xychart.SimpleTimePlot)1 TimePlot (com.twosigma.beakerx.chart.xychart.TimePlot)1 ConstantLine (com.twosigma.beakerx.chart.xychart.plotitem.ConstantLine)1 Line (com.twosigma.beakerx.chart.xychart.plotitem.Line)1 Test (org.junit.Test)1