Chart for .NET / User's Guide / Layout / Bounds Mode

In This Topic
    Bounds Mode
    In This Topic

    All content panels have a property called BoundsMode that determines how the contents of the panel should fit the bounds determined by the layout manager. The following table shows the supported bound modes:

    BoundsMode Description
    None In this mode the panel does not try to fit in the bounds defined by the layout manager. It will only make sure that the center of the panel contents matches the center of the bounds.
    Fit

    In this mode the panel contents does not break outside the panel bounds by scaling without breaking the aspect ration of the panel content.

    Stretch

    In this mode the panel contents does not break outside the panel bounds by scaling along X and Y as much as needed to fit the entire bounds with the panel contents. This bounds mode does not preserve the aspect ratio of the original panel contents.


    The following code modifies the BoundsMode of the first chart in the Charts collection:

    C#
    Copy Code
    NChart chart = chartControl.Charts[0];
    chart.BoundsMode = BoundsMode.Fit;
    
    Visual Basic
    Copy Code
    Dim chart As NChart = chartControl.Charts(0)
    chart.BoundsMode = BoundsMode.Fit
    
    Note that if you modify the Zoom property of the chart projection that chart may break outside the bounds.
    See Also