This commit is contained in:
@@ -1,10 +1,9 @@
|
||||
package com.example.views;
|
||||
|
||||
import com.example.components.BarChart;
|
||||
import com.example.components.Card;
|
||||
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;
|
||||
@@ -51,20 +50,8 @@ public class DashboardView extends VerticalLayout {
|
||||
Notification.show("Slice %d".formatted(e.getDataPointIndex()));
|
||||
});
|
||||
|
||||
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;
|
||||
add(new Card("Umsatz-Entwicklung", lineChart),
|
||||
new Card("Umsatz nach Monat", barChart),
|
||||
new Card("Umsatz nach Region", pieChart));
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user