I’m working on a Vaadin 10 Demo and would like now to display some (chartJS) charts in a view:
(Alternatively JFreeChart)
How does it work? the doc I found tell it is supported in Vaadin8+ ?
@Route(value = "test", layout = MainLayout.class)
public class ChartJSDemo extends VerticalLayout {
public ChartJSDemo() {
InitChart();
}
void InitChart() {
PieChartConfig config = new PieChartConfig();
config.data().labels("Red", "Green", "Yellow").addDataset(new PieDataset().label("Dataset 1")).and();
//some init stuff
ChartJs chart = new ChartJs(config);
chart.setJsLoggingEnabled(true);
add(chart); add chart to view ???
}
}
Thanks for a hint / code snippet