dotnetCHARTING Send comments on this topic.
Margin Property
See Also  Example
dotnetCHARTING Namespace > Chart Class : Margin Property


Gets or sets a string which automatically sets multiple margins as a shortcut.

Syntax

Visual Basic (Declaration)  
Public WriteOnly Property Margin 
Visual Basic (Usage) Copy Code
Dim instance As Chart
 
instance.Margin = value
C#  
public void Margin {set;}

Example

C# Copy Code
Chart.Margin = "10"; //set all 4 Margins to 10
Chart.Margin = "10,20"; // set MarginLeft and MarginRight to 10 and MarginTop and Bottom to 20
Chart.Margin = "5,10,15"; // set MarginLeft to 5, MarginTop to 10 and MarginRight to 15
Chart.Margin = "5,10,15,20"; // set MarginLeft to 5, MarginTop to 10, MarginRight to 15 and MarginBottom to 20  
Visual Basic Copy Code
Chart.Margin = "10" 'set all 4 Margins to 10
Chart.Margin = "10,20" 'set MarginLeft and MarginRight to 10 and MarginTop and Bottom to 20
Chart.Margin = "5,10,15" 'set MarginLeft to 5, MarginTop to 10 and MarginRight to 15
Chart.Margin = "5,10,15,20" 'set MarginLeft to 5, MarginTop to 10, MarginRight to 15 and MarginBottom to 20

Remarks

Controls the margins or amount of space in pixels that will be left around the charting elements including the Legend and title box. This property can be used in conjunction with the Chart.Background property to easily implement attractive custom borders or just pad the chart as you please. The property accepts margins "Left, Top, Right, Bottom" in pixels.
Negative values are allowed.

See Also