Reputation: 113
XYMultipleSeriesRenderer renderer = buildBarRenderer(colors);
renderer.setOrientation(Orientation.HORIZONTAL);
setChartSettings(renderer, "Monthly sales in the last 1 years", "Cars", "sold", 0, 5, 0, 100, ColorUtil.GRAY, ColorUtil.LTGRAY);
renderer.setXLabels(1);
renderer.setYLabels(5);
renderer.setBarWidth(40);
renderer.setLabelsTextSize(8.0f);
Label text size is not rendering in Bar Charts?
Upvotes: 1
Views: 63
Reputation: 52760
You are setting the text size to 8 pixels which will make it pretty small and might not work if your fonts aren't native fonts. Try something like this.
renderer.setLabelsTextFont(Font.createTrueTypeFont("native:MainThin", "native:MainThin"));
renderer.setLabelsTextSize(convertToPixels(5));
Upvotes: 1