Hi, I tried user Chart on Dialog but I

Hi, I tried use Chart on Dialog but I got javascript errors. Same other place on the ui view works without any problem. What is the right way on dialog?


protected void openDiagram(LampWrapper lampWrapper, String... inputs) {
    Dialog dialog = new Dialog();
    ApexCharts chart = ChartLayout.createHistoryApexChart();
    chart.setWidthFull();
Futures futures = new Futures();
futures.add(service.historyAsync(System.currentTimeMillis() - TimeUnit.DAYS.toMillis(14), System.currentTimeMillis(), inputs, lampWrapper.getTarget()));
futures.with(new HistoryWrapper(), targetHistory ->
        UIUtils.access(getUI(), () -> {
            refreshChart(chart, targetHistory, inputs);
        })
).execute();

dialog.setHeight(“600px”);
dialog.setWidth(“800px”);
dialog.add(chart);
dialog.open();

}

My reply might come too late but:

I tried adding a chart to a dialog and it worked for me (with the current version of 24.0.1).

Which version did you use? Have you tried it with a minimal chart configuration? (e.g without formatters and all of that).


Dear Lars,

thank you for your reply.

I found the reason was the chart display first time without empty series.

Working well for a long time, thanx for library.

:)

Karl