Initial commit
This commit is contained in:
@@ -0,0 +1,28 @@
|
||||
package com.example.views;
|
||||
|
||||
import com.example.components.ApexChart;
|
||||
import com.vaadin.flow.component.notification.Notification;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.router.Route;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Route("")
|
||||
public class DashboardView extends VerticalLayout {
|
||||
|
||||
public DashboardView() {
|
||||
ApexChart chart = new ApexChart();
|
||||
chart.setWidthFull();
|
||||
chart.setHeight("400px");
|
||||
chart.setData("Umsatz 2026",
|
||||
List.of(30.0, 40.0, 35.0, 50.0, 49.0, 60.0),
|
||||
List.of("Jan", "Feb", "Mär", "Apr", "Mai", "Jun"));
|
||||
|
||||
chart.addPointClickListener(e -> {
|
||||
Notification.show("Serie %d, Punkt %d"
|
||||
.formatted(e.getSeriesIndex(), e.getDataPointIndex()));
|
||||
});
|
||||
|
||||
add(chart);
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user