Xceed Chart for WinForms v4.4 Documentation
Xceed.Chart.Core.v4.4 Assembly / Xceed.Chart.Core Namespace / Chart Class / MarginMode Property
Example


In This Topic
    MarginMode Property
    In This Topic
    Defines the strategy used to fit the chart into the chart area (margins).
    Syntax
    'Declaration
     
    <CategoryAttribute("Margins")>
    <DescriptionAttribute("Defines the strategy used to fit the chart into the chart area.")>
    <DefaultValueAttribute(Mono.Cecil.CustomAttributeArgument)>
    Public Property MarginMode As MarginMode
    'Usage
     
    Dim instance As Chart
    Dim value As MarginMode
     
    instance.MarginMode = value
     
    value = instance.MarginMode
    [Category("Margins")]
    [Description("Defines the strategy used to fit the chart into the chart area.")]
    [DefaultValue(Mono.Cecil.CustomAttributeArgument)]
    public MarginMode MarginMode {get; set;}
    Remarks
    The possible values for this property are MarginMode.None, MarginMode.Stretch MarginMode.Fit.
    • None - the chart will not try to align to the chart area.
    • Fit - the chart will stretch along X and Y in order to fill as much as possible of the chart area preserving the chart proportions. Typically you'll use Fit mode for 3D charts.
    • Stretch - the chart will stretch along X and Y in order to fill as much as possible of the chart area without breaking outside. This margin mode does not preserve the chart proportions. Typically you'll use Stretch mode for 2D charts.
    Example
    The following code modifies the chart fit mode and chart margins:
    Dim chart As Chart = CType(nChartControl1.Charts.GetAt(0), Chart)
    chart.MarginMode = MarginMode.Stretch
    chart.Margins = New RectangleF(10, 10, 80, 80)
    chart.View.SetPredefinedProjection(PredefinedProjection.Orthogonal)
    Chart chart = (Chart)nChartControl1.Charts.GetAt(0);
    chart.MarginMode = MarginMode.Stretch;
    chart.Margins = new RectangleF(10, 10, 80, 80);
    chart.View.SetPredefinedProjection(PredefinedProjection.Orthogonal);
    Requirements

    Target Platforms: Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

    See Also