Legend on the graph pie - add-on dcharts

Hello guys, I have a doubt about the add-on dcharts, appears only the first element of the legend label in pie graph.
the following code:


 DataSeries dataSeries = new DataSeries()
                .newSeries()
                .add("error", 23)
                .add("none", 0)
                .add("click", 5)
                .add("impression", 25);
        
        Legend legend = new Legend()
                .setShowLabels(true)
                .setShow(true);

        

        SeriesDefaults seriesDefaults = new SeriesDefaults()
                .setRenderer(SeriesRenderers.PIE)
                .setRendererOptions(
                new PieRenderer()
                .setShowDataLabels(true))
                .setShowLabel(true);

        Highlighter highlighter = new Highlighter()
                .setShow(true)
                .setShowTooltip(true)
                .setTooltipAlwaysVisible(true)
                .setKeepTooltipInsideChart(true);

        Options options = new Options()
                .setSeriesDefaults(seriesDefaults)
                .setLegend(legend)
                .setHighlighter(highlighter);

        DCharts chart = new DCharts()
                .setDataSeries(dataSeries)
                .setOptions(options)
                .show();
        layout.addComponent(chart);

Thank you in advance,
Alexandre

solved?

just change :

DataSeries dataSeries = new DataSeries()
.newSeries()
.add(“error”, 23)
.add(“none”, 0)
.add(“click”, 5)
.add(“impression”, 25);

to :

DataSeries dataSeries = new DataSeries();
dataSeries.newSeries().add(“none”, 23);
dataSeries.newSeries().add(“click”, 5);
dataSeries.newSeries().add(“error”, 0);
dataSeries.newSeries().add(“impression”, 25);

and should work fine :slight_smile: