Search in sources :

Example 1 with TimePlot

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

the class GroovyEvaluatorChartTest method parseTimePlotScript_returnTimePlotObject.

@Test
public void parseTimePlotScript_returnTimePlotObject() {
    // when
    Object result = parseClassFromScript("def today = new Date();\n" + "def millis = today.time;\n" + "def hour = 1000 * 60 * 60;\n" + "def plot = new TimePlot( timeZone: new SimpleTimeZone(10800000, \"America/New_York\"));\n" + "plot << new Points(x:(0..10).collect{millis + hour * it}, y:(0..10));");
    // then
    Assertions.assertThat(result instanceof TimePlot).isTrue();
    TimePlot timePlot = (TimePlot) result;
    Assertions.assertThat(timePlot.getGraphics()).isNotEmpty();
}
Also used : TimePlot(com.twosigma.beakerx.chart.xychart.TimePlot) SimpleTimePlot(com.twosigma.beakerx.chart.xychart.SimpleTimePlot) Test(org.junit.Test)

Aggregations

SimpleTimePlot (com.twosigma.beakerx.chart.xychart.SimpleTimePlot)1 TimePlot (com.twosigma.beakerx.chart.xychart.TimePlot)1 Test (org.junit.Test)1