Gantt chart refresh with updated data

I have a gantt-chart where I can edit data by calling the editor screen from it’s listener. After I have updated, I want to refresh the chart. I called refresh to the ganttChart but it’s not refreshed with updated data. Thanks in advance for your help. I have attached a sample project.

ganttdemo2.zip (660.5K)

Hi,
there are several errors in your sample project:

  1. Do not use “minimum” and “maximum” parameters for valueAxis with type=“date.” You have to use “minimumDate” and “maximumDate” parameters in the format of date or date time.

  2. Your code does not handle commit event after editor close, and neither data sources nor chart are refreshed.

The event handling logic will be as follows:


ganttChart.addGraphItemClickListener(event -> {
    ProductionPlanLine productionPlanLine = (ProductionPlanLine) event.getItem();

    AbstractEditor editor = openEditor("ganttdemo$ProductionPlanLine.edit",
            productionPlanLine, OpenType.DIALOG);
    editor.addCloseWithCommitListener(() -> {
        productionPlansDs.refresh();
        productionPlanLinesDs.refresh();
    });
});
  1. Do not call repaint on a chart if you use it with attached data source since components automatically track changes of the connected data source.

And thank you for your sample project, we have found the bug with initialization of Gantt chart properties. You can use the workaround and set dataDateFormat to your ganttChart to see your chart.


<chart:ganttChart id="ganttChart"
                  dataDateFormat="YYYY-MM-DD JJ:NN:SS:QQQ">
    ...
</chart:ganttChart>

The bug is fixed, and the fix will be included in 6.3.0 release.

Thank you so much Yuriy.