A value of true for setFitLegend () will cause the chart to render only the space that is required and make the chart fit the screen. In addition, you can also manually set the fields with the required values.
renderer.setFitLegend(true);
OR
renderer.setMargins(new int[] {30, 30, -100, 30});
Have only one or both of these methods. Please note that you will need to adjust the margin values ββby trial and error if you decide that both methods display the chart correctly. The values ββin setMargins () are values ββthat fit my needs. Change them as needed.
PS: The setMargins () method takes values ββin the form of top, left, bottom, and right in this order.
source share