XSSFClientAnchor constructor consists of 8 elements. Most important are the last four and these define the position of chart measured in cells. So, we'll define anchor with parameters a1 ... a8 and picture shows which parameter defines which distance.

XSSFClientAnchor anchor = drawing.createAnchor(a1, a2, a3, a4, a5, a6, a7, a8);

XSSFClientAnchor setup

a5 - represents the horizontal distance of the beginning of the chart (in cells)

a6 - represents the vertical distance from the top (in cells)

a7 - represents the horizontal distance of the end of the chart (in cells)

a8 - represents the vertical distance of the end of the chart from the top (in cells) 

Complete code example with charts could be found in this article

Pin It

Newsletter

Please enable the javascript to submit this form

Latest