Perform auto-scaling of the axes (if any) and compute the positions of the various objects in the chart.
ChartDirector automatically lays out the chart when creating the chart output (eg. using BaseChart.makeChart
). There is usually no need to layout explicitly.
However, if you would like to draw custom objects whose positions depend on the axis scales or the position of other objects, you may call the layout method to auto-scaling the axes (for charts that have axes) and to fix the positions of chart objects before creating the chart output.
You should not modify the positions of existing chart objects or add more data to the chart after layout.
Note that there is a similar method BaseChart.layoutLegend
that lays out the legend box only. For XYChart
objects, there is a method XYChart.layoutAxes
that lays out and auto-scales the axes only. They allow the legend box size, axis scale, and axis thickness to be known without fixing the positions of all chart objects.
© 2021 Advanced Software Engineering Limited. All rights reserved.