Search in sources :

Example 1 with Bars

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

the class PlotObjectSerializerTest method serializeXYGraphics_returnTrue.

@Test
public void serializeXYGraphics_returnTrue() throws Exception {
    Bars obj = new Bars();
    obj.setX(Arrays.asList(10, 20));
    obj.setY(Arrays.asList(10, 20));
    obj.setDisplayName("test display name");
    // when
    boolean result = plotObjectSerializer.writeObject(obj, jgen, true);
    // then
    Assertions.assertThat(result).isTrue();
}
Also used : Bars(com.twosigma.beakerx.chart.xychart.plotitem.Bars) Test(org.junit.Test) KernelTest(com.twosigma.beakerx.KernelTest)

Example 2 with Bars

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

the class BarsSerializerTest method initTestStubData.

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

Example 3 with Bars

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

the class ToolTipBuilderTest method setUp.

@Before
public void setUp() throws Exception {
    xyGraphics = new Bars();
    xyGraphics.setX(Arrays.asList(10, 20));
    xyGraphics.setY(Arrays.asList(10, 20));
    xyGraphics.setBase(5);
    xyGraphics.setDisplayName("test display name");
}
Also used : Bars(com.twosigma.beakerx.chart.xychart.plotitem.Bars) Before(org.junit.Before)

Example 4 with Bars

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

the class GraphicsActionTest method setUp.

@Before
public void setUp() throws Exception {
    kernel = new KernelTest();
    KernelManager.register(kernel);
    xyGraphics = new Bars();
    xyGraphics.setX(Arrays.asList(10, 20));
    xyGraphics.setY(Arrays.asList(10, 20));
    xyGraphics.setDisplayName("test display name");
    actionListener = new GraphicsActionListenerStub();
}
Also used : KernelTest(com.twosigma.beakerx.KernelTest) Bars(com.twosigma.beakerx.chart.xychart.plotitem.Bars) Before(org.junit.Before)

Example 5 with Bars

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

the class GroovyEvaluatorChartTest method parsePlotWithBarsScript_returnPlotObjectWithBars.

@Test
public void parsePlotWithBarsScript_returnPlotObjectWithBars() {
    // when
    Object result = parseClassFromScript("def plot = new Plot()\n" + "plot << new Bars(x: (1..5), y: [3, 5, 2, 3, 7])");
    // then
    Assertions.assertThat(result instanceof Plot).isTrue();
    Plot plot = (Plot) result;
    Assertions.assertThat(plot.getGraphics()).isNotEmpty();
    Assertions.assertThat(plot.getGraphics().get(0) instanceof Bars).isTrue();
}
Also used : 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) CategoryBars(com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars) Bars(com.twosigma.beakerx.chart.xychart.plotitem.Bars) Test(org.junit.Test)

Aggregations

Bars (com.twosigma.beakerx.chart.xychart.plotitem.Bars)5 Before (org.junit.Before)3 KernelTest (com.twosigma.beakerx.KernelTest)2 Test (org.junit.Test)2 CategoryPlot (com.twosigma.beakerx.chart.categoryplot.CategoryPlot)1 CategoryBars (com.twosigma.beakerx.chart.categoryplot.plotitem.CategoryBars)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 StringWriter (java.io.StringWriter)1