Interface IOfficeChartLayout
Represents the layout of the chart element.
Inherited Members
Namespace: Syncfusion.OfficeChart
Assembly: Syncfusion.OfficeChart.NET.dll
Syntax
public interface IOfficeChartLayout : IParentApplication
Properties
Height
Gets or sets the height (if Height Mode is Factor) or bottom (if Height Mode is edge) of the chart element as a fraction of the height of the chart.
Declaration
double Height { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
HeightMode
Gets or sets how to interpret the Height element for this manual layout.
Declaration
LayoutModes HeightMode { get; set; }
Property Value
Type |
---|
LayoutModes |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
LayoutTarget
Gets or sets whether to layout only the plot area.
Declaration
LayoutTargets LayoutTarget { get; set; }
Property Value
Type |
---|
LayoutTargets |
Left
Gets or sets the x location (left) of the chart element as a fraction of the width of the chart. If Left Mode is Factor, then the position is relative to the default position for the chart element.
Declaration
double Left { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
LeftMode
Gets or sets how to interpret the Left element for this manual layout
Declaration
LayoutModes LeftMode { get; set; }
Property Value
Type |
---|
LayoutModes |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
ManualLayout
Gets or sets the manual layout of the chart element.
Declaration
IOfficeChartManualLayout ManualLayout { get; set; }
Property Value
Type |
---|
IOfficeChartManualLayout |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Get the manual layout
IOfficeChartManualLayout manualLayout = layout.ManualLayout;
//Modify the manual layout left position
manualLayout.Left = 100;
//Modify the manual layout left mode
manualLayout.LeftMode = LayoutModes.factor;
//Modify the manual layout top position
manualLayout.Top = 100;
//Modify the manual layout top mode
manualLayout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Get the manual layout
Dim manualLayout As IOfficeChartManualLayout = layout.ManualLayout
'Modify the manual layout left position
manualLayout.Left = 100
'Modify the manual layout left mode
manualLayout.LeftMode = LayoutModes.factor
'Modify the manual layout top position
manualLayout.Top = 100
'Modify the manual layout top mode
manualLayout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Top
Gets or sets the top of the chart element as a fraction of the height of the chart. If Top Mode is Factor, then the position is relative to the default position for the chart element.
Declaration
double Top { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
TopMode
Gets or sets how to interpret the Top element for this manual layout.
Declaration
LayoutModes TopMode { get; set; }
Property Value
Type |
---|
LayoutModes |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Width
Gets or sets the width (if Width Mode is Factor) or right (if Width Mode is Edge) of the chart element as a fraction of the width of the chart.
Declaration
double Width { get; set; }
Property Value
Type |
---|
System.Double |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
WidthMode
Gets or sets how to interpret the Width element for this manual layout.
Declaration
LayoutModes WidthMode { get; set; }
Property Value
Type |
---|
LayoutModes |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[0].Charts[0] as IPresentationChart;
//Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top;
//Get the legend layout
IOfficeChartLayout layout = chart.Legend.Layout;
//Modify the legend layout height
layout.Height = 120;
//Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor;
//Modify the legend layout width
layout.Width = 100;
//Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge;
//Modify the legend layout left position
layout.Left = 100;
//Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor;
//Modify the legend layout top position
layout.Top = 100;
//Modify the legend layout top mode
layout.TopMode = LayoutModes.factor;
//Save the presentation
presentation.Save("Output.pptx");
//Close the presentation
presentation.Close();
'Open a presentation
Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
'Get the chart from the first slide
Dim chart As IPresentationChart = TryCast(presentation__1.Slides(0).Charts(0), IPresentationChart)
'Set the legend position
chart.Legend.Position = OfficeLegendPosition.Top
'Get the legend layout
Dim layout As IOfficeChartLayout = chart.Legend.Layout
'Modify the legend layout height
layout.Height = 120
'Modify the legend layout height mode
layout.HeightMode = LayoutModes.factor
'Modify the legend layout width
layout.Width = 100
'Modify the legend layout width mode
layout.WidthMode = LayoutModes.edge
'Modify the legend layout left position
layout.Left = 100
'Modify the legend layout left mode
layout.LeftMode = LayoutModes.factor
'Modify the legend layout top position
layout.Top = 100
'Modify the legend layout top mode
layout.TopMode = LayoutModes.factor
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()