ApexChart

Does anybody have an example or can tell me how to display an ApexChart in a Dialog?
I tried the following:
ApexChartsBuilder apexCB = new ApexChartsBuilder(); apexCB.withChart(ChartBuilder.get().withType(Type.PIE).build())
.withLabels(“Team A”, “Team B”, “Team C”, “Team D”, “Team E”)
.withLegend(LegendBuilder.get()
.withPosition(Position.RIGHT)
.build())
.withSeries(44.0, 55.0, 13.0, 43.0, 22.0)
.withResponsive(ResponsiveBuilder.get()
.withBreakpoint(480.0)
.withOptions(OptionsBuilder.get()
.withLegend(LegendBuilder.get()
.withPosition(Position.BOTTOM)
.build())
.build())
.build());
dialog.add(apexCB);

The problem is that apexCB is not a component but I don’t know how to generally display the charts.

What is the return type of apexCB.build() if it’s not extending from component?