To add a chart to your Wicket page, include the following HTML and Java fragments into your code:
<!-- HTML code --> <div> <canvas wicket:id="chart"</canvas> </div>
// Java code ChartConfiguration chart = new ChartConfiguration(); chart.setType(ChartType.LINE); chart.setOptions(new Options().setTitle(new Title().setText("My Chart"))); chart.setData(new Data().setDatasets(Arrays.asList(new Dataset().setData(IntegerValue.of(1,2,3,4))))); //to see more options, select a chart below and click the button "Show Java code" add(new Chart("chart", chart));