appreciated / apexcharts-flow

ApexCharts.js wrapper for the Vaadin Platform
Apache License 2.0
77 stars 47 forks source link

Support total DataLabel on stacked bar chart #172

Closed khauser closed 6 months ago

khauser commented 1 year ago

ApexCharts supports this here: https://apexcharts.com/javascript-chart-demos/bar-charts/stacked/

I'm not able to do this with:

ApexCharts areaChart = ApexChartsBuilder.get()
                                        .withChart(ChartBuilder.get()
                                                               .withType(Type.BAR)
                                                               .withStacked(true)
                                                               .withToolbar(ToolbarBuilder.get()
                                                                                          .withShow(true)
                                                                                          .build())
                                                               .withHeight("400px")
                                                               .withWidth("100%")
                                                               .build())
                                        .withDataLabels(DataLabelsBuilder.get().withEnabled(false).build())
                                        .withStroke(StrokeBuilder.get().withCurve(Curve.STRAIGHT).build())
                                        .withSeries(array)
                                        .withXaxis(XAxisBuilder.get()
                                                               .withCategories(years.toArray(new String[0]))
                                                               .build())
                                        .withYaxis(YAxisBuilder.get().withOpposite(true).build())
                                        .withLegend(LegendBuilder.get()
                                                                 .withHorizontalAlign(HorizontalAlign.LEFT)
                                                                 .build())
                                        .build();

I tried also something like .withPlotOptions(PlotOptionsBuilder.get().withBar(BarBuilder.get().withDataLabels(**<??? no BUILDER ???>**)))

Loahrs commented 6 months ago

I created a PR to allow configuring the total DataLabel.