GanttChart show current date line

How to do this in jmix?

Hello!

Using this example: Samples UI::gantt-chart-dates you can add the following code:

@Autowired
private GanttChart ganttChart;

@Subscribe
public void onInit(InitEvent event) {
    Guide guide = new Guide();
    guide.setValue(new Date(1458020460000L));
    guide.setToValue(new Date(1458106860000L));
    guide.setFillAlpha(1.0);
    guide.setFillColor(new Color("#0cb800"));
    guide.setBalloonText("Current date");
    ganttChart.getValueAxis().addGuides(guide);
}

image

2 Likes

Perfect, thank you Roman.

Please, update the “Samples UI” example with this code.