Java - Xeiam's XChart Marker With Values

I've been trying to figure out if it is possible to put the exact value for each Bar/Line Marker.

Current Result : enter image description here

Desired Result : enter image description here

Upvotes: 1

Views: 735

Answers (1)

Dheeraj
Dheeraj

Reputation: 342

In Xchart library, to get the count of each bar use annotations.

CategoryChart chart = new CategoryChartBuilder()
            .yAxisTitle("ABC Title")
            .theme(Styler.ChartTheme.GGPlot2).build();

    //each stack count and total count of each bar
    chart.getStyler().setHasAnnotations(true);
    chart.getStyler().setShowTotalAnnotations(true);
    chart.getStyler().setAnnotationsPosition(1);

Upvotes: 0

Related Questions