ceTe Software Help Library for Java August - 2020
DynamicPDF Generator for Java / Programming with Generator for Java / Charts / Chart Elements / Plot Area
In This Topic
    Plot Area
    In This Topic

    Every Chart contains one or more PlotAreas. The PlotArea is the object that actually contains the series (one or more series). The PlotArea is the actual area within the bounds of the Chart where the series will be plotted.  By default, every Chart contains a PrimaryPlotArea and every PlotArea (including the PrimaryPlotArea) contains a  X and Y axes.  In many cases, a Chart can be created and the DefaultChartArea can begin having series added to it. Usually, only more advanced charts would need multiple PlotAreas in the same Chart.

    If the Chart's AutoLayout property is set to True (by default it is) the PlotAreas in that Chart will be laid out automatically.  In other words, when the AutoLayout property is set to True, the PlotAreas inside that Chart will have their X, Y, Height and Width properties automatically determined and set so that all PlotAreas are aligned vertically. If manual control over the PlotArea's layout is desired, then the Chart's AutoLayout property should be set to False. The Chart's Layout method should be called and then the PlotArea's properties (X, Y, Height and Width) can be manually set.

    To get the default plot area from the chart the following code can be used.

    [Java]
        Chart chart = new Chart(0, 0, 400, 200);
        PlotArea plotArea = chart.getPrimaryPlotArea();
    
    To create a new plot area the following code can be used.
    
    [Java]
        Chart chart = new Chart(0, 0, 700, 400);
        PlotArea plotArea = chart.getPlotAreas().add(50, 50, 300, 300);
    
    See Also