This commit is contained in:
@@ -3,16 +3,22 @@ package com.example.views;
|
||||
import com.example.components.BarChart;
|
||||
import com.example.components.LineChart;
|
||||
import com.example.components.PieChart;
|
||||
import com.vaadin.flow.component.Component;
|
||||
import com.vaadin.flow.component.html.H3;
|
||||
import com.vaadin.flow.component.notification.Notification;
|
||||
import com.vaadin.flow.component.orderedlayout.VerticalLayout;
|
||||
import com.vaadin.flow.router.PageTitle;
|
||||
import com.vaadin.flow.router.Route;
|
||||
|
||||
import java.util.List;
|
||||
|
||||
@Route("")
|
||||
@PageTitle("Dashboard")
|
||||
public class DashboardView extends VerticalLayout {
|
||||
|
||||
public DashboardView() {
|
||||
addClassName("dialect-content");
|
||||
|
||||
LineChart lineChart = new LineChart();
|
||||
lineChart.setWidthFull();
|
||||
lineChart.setHeight("400px");
|
||||
@@ -45,6 +51,20 @@ public class DashboardView extends VerticalLayout {
|
||||
Notification.show("Slice %d".formatted(e.getDataPointIndex()));
|
||||
});
|
||||
|
||||
add(lineChart, barChart, pieChart);
|
||||
add(card("Umsatz-Entwicklung", lineChart),
|
||||
card("Umsatz nach Monat", barChart),
|
||||
card("Umsatz nach Region", pieChart));
|
||||
}
|
||||
|
||||
private Component card(String title, Component chart) {
|
||||
H3 heading = new H3(title);
|
||||
heading.addClassName("dialect-card__title");
|
||||
|
||||
VerticalLayout card = new VerticalLayout(heading, chart);
|
||||
card.addClassName("dialect-card");
|
||||
card.setWidthFull();
|
||||
card.setPadding(false);
|
||||
card.setSpacing(false);
|
||||
return card;
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user