Interface IOfficeChartCategories
Represents the collection of IOfficeChartCategory
Inherited Members
Namespace: Syncfusion.OfficeChart
Assembly: Syncfusion.OfficeChart.NET.dll
Syntax
public interface IOfficeChartCategories : IParentApplication, ICollection<IOfficeChartCategory>, IEnumerable<IOfficeChartCategory>, IEnumerable
Properties
Count
Gets the number of IOfficeChartCategory objects in the collection. Read-only Long.
Declaration
int Count { get; }
Property Value
Type |
---|
System.Int32 |
Examples
//Open a presentation
IPresentation presentation = Presentation.Open("Template.pptx");
//Get the chart from the first slide
IPresentationChart chart = presentation.Slides[1].Charts[0] as IPresentationChart;
//Get the categories of chart
IOfficeChartCategories categories = chart.Categories;
//Get the count of categories
int count = categories.Count;
//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(1).Charts(0), IPresentationChart)
'Get the categories of chart
Dim categories As IOfficeChartCategories = chart.Categories
'Get the count of categories
Dim count As Integer = categories.Count
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Item[Int32]
Gets a single IOfficeChartCategory instance at the specified index from the collection. Read-only.
Declaration
IOfficeChartCategory this[int index] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.Int32 | index | The zero-based index of the element. |
Property Value
Type | Description |
---|---|
IOfficeChartCategory | Returns the particular category based on the index. |
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;
//Get the categories of chart
IOfficeChartCategories categories = chart.Categories;
//Get the name of the category
string name = categories[0].Name;
//Set the category filter
categories[0].IsFiltered = true;
//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)
'Get the categories of chart
Dim categories As IOfficeChartCategories = chart.Categories
'Get the name of the category
Dim name As String = categories(0).Name
'Set the category filter
categories(0).IsFiltered = True
'Save the presentation
presentation__1.Save("Output.pptx")
'Close the presentation
presentation__1.Close()
Item[String]
Gets a single IOfficeChartCategory instance with the specified index from the collection. Read-only.
Declaration
IOfficeChartCategory this[string name] { get; }
Parameters
Type | Name | Description |
---|---|---|
System.String | name | Name of the category |
Property Value
Type | Description |
---|---|
IOfficeChartCategory | Returns the particular category based on the given name. |