Search in sources :

Example 11 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.

the class MultipleValueaxisChart method onInit.

@Subscribe
protected void onInit(InitEvent event) {
    List<DateValueVolume> items = new ArrayList<>();
    Date startDate = DateUtils.addDays(timeSource.currentTimestamp(), -DAYS_COUNT);
    for (int i = 0; i < DAYS_COUNT; i++) {
        items.add(generateDateValueVolume(DateUtils.addDays(startDate, i), i));
    }
    lineChartDc.setItems(items);
}
Also used : DateValueVolume(charts.ex1.entity.DateValueVolume) ArrayList(java.util.ArrayList) Date(java.util.Date) Subscribe(io.jmix.ui.screen.Subscribe)

Example 12 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.

the class ContainerDataProviderScreen method onInit.

@Subscribe
private void onInit(InitEvent event) {
    stackedArea.setDataProvider(new ContainerDataProvider(transportCountsDc));
    stackedArea.setCategoryField("year");
}
Also used : ContainerDataProvider(io.jmix.ui.data.impl.ContainerDataProvider) Subscribe(io.jmix.ui.screen.Subscribe)

Example 13 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.

the class OrdersHistory method onInit.

// end::queue[]
// tag::orders-history2[]
@Subscribe
private void onInit(InitEvent event) {
    // <2>
    Order initialValue = metadata.create(Order.class);
    initialValue.setAmount(new BigDecimal(random.nextInt(1000) + 100));
    initialValue.setDate(timeSource.currentTimestamp());
    // <3>
    ordersDc.getMutableItems().add(initialValue);
}
Also used : Order(charts.ex1.entity.Order) BigDecimal(java.math.BigDecimal) Subscribe(io.jmix.ui.screen.Subscribe)

Example 14 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.

the class OrdersHistory method onTimerTick.

// end::orders-history2[]
// tag::orders-history3[]
@Subscribe("updateChartTimer")
private void onTimerTick(Timer.TimerActionEvent event) {
    // <4>
    Order orderHistory = metadata.create(Order.class);
    orderHistory.setAmount(new BigDecimal(random.nextInt(1000) + 100));
    orderHistory.setDate(timeSource.currentTimestamp());
    ordersDc.getMutableItems().add(orderHistory);
    // end::orders-history3[]
    // tag::queue-code[]
    // <1>
    itemsQueue.add(orderHistory);
    if (itemsQueue.size() > 10) {
        // <2>
        ordersDc.getMutableItems().remove(0);
        System.out.println("in");
    }
    // end::queue-code[]
    // tag::orders-history4[]
    System.out.println("get");
}
Also used : Order(charts.ex1.entity.Order) BigDecimal(java.math.BigDecimal) Subscribe(io.jmix.ui.screen.Subscribe)

Example 15 with Subscribe

use of io.jmix.ui.screen.Subscribe in project jmix-docs by Haulmont.

the class SerialChartJsonTitleTwo method onInit.

@Subscribe
private void onInit(InitEvent event) {
    ListDataProvider serialChartDataProvider = new ListDataProvider();
    int[] serialChartData = { 5, 7, 6, 9, 7, 8, 5, 6, 4, 6, 5, 7, 4, 5, 3, 4, 2, 0 };
    for (int i = 0; i < serialChartData.length; i++) {
        serialChartDataProvider.addItem(graphData(serialChartData[i]));
    }
    serialChart.setDataProvider(serialChartDataProvider);
}
Also used : ListDataProvider(io.jmix.ui.data.impl.ListDataProvider) Subscribe(io.jmix.ui.screen.Subscribe)

Aggregations

Subscribe (io.jmix.ui.screen.Subscribe)79 Report (io.jmix.reports.entity.Report)8 Screen (io.jmix.ui.screen.Screen)8 ListDataProvider (io.jmix.ui.data.impl.ListDataProvider)5 UiController (io.jmix.ui.screen.UiController)5 UiDescriptor (io.jmix.ui.screen.UiDescriptor)5 UUID (java.util.UUID)5 Autowired (org.springframework.beans.factory.annotation.Autowired)5 ReportOutputDocument (com.haulmont.yarg.reporting.ReportOutputDocument)4 FileRef (io.jmix.core.FileRef)4 BigDecimal (java.math.BigDecimal)4 Date (java.util.Date)4 List (java.util.List)4 Order (test_support.entity.sales.Order)4 Metadata (io.jmix.core.Metadata)3 Visit (io.jmix.petclinic.entity.visit.Visit)3 UiReportRunContext (io.jmix.reportsui.runner.UiReportRunContext)3 FilterCondition (io.jmix.ui.entity.FilterCondition)3 GroupFilterCondition (io.jmix.ui.entity.GroupFilterCondition)3 LogicalFilterCondition (io.jmix.ui.entity.LogicalFilterCondition)3