WPF

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IOfficeChartCategory

    Show / Hide Table of Contents

    Interface IOfficeChartCategory

    Represents the chart category

    Inherited Members
    IParentApplication.Parent
    Namespace: Syncfusion.OfficeChart
    Assembly: Syncfusion.OfficeChart.Base.dll
    Syntax
    public interface IOfficeChartCategory : IParentApplication

    Properties

    CategoryLabel

    Gets the category labels of the category. Read-only.

    Declaration
    IOfficeDataRange CategoryLabel { get; }
    Property Value
    Type Description
    IOfficeDataRange
    Examples
    IPresentation presentation = Presentation.Open("Template.pptx");
    ISlide slide = presentation.Slides[0];
    //Get the chart from slide
    IPresentationChart chart = slide.Shapes[0] as IPresentationChart;           
    //Get the category from the category collection
    IOfficeChartCategory category = chart.Categories[0];
    //Get the name of the category
    string name = category.Name;
    //Get the category label, read only
    IOfficeDataRange dataRange = category.CategoryLabel;
    //Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol");
    dataRange.SetValue(2, 4, 290);
    //Get the values of category
    IOfficeDataRange values = category.Values;
    //Set the value
    values.SetValue(3, 2, 120);
    values.SetValue(5, 2, 320);           
    //Save the presentation
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
    Dim slide As ISlide = presentation__1.Slides(0)
    'Get the chart from slide
    Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
    'Get the category from the category collection
    Dim category As IOfficeChartCategory = chart.Categories(0)
    'Get the name of the category
    Dim name As String = category.Name
    'Get the category label, read only
    Dim dataRange As IOfficeDataRange = category.CategoryLabel
    'Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol")
    dataRange.SetValue(2, 4, 290)
    'Get the values of category
    Dim values As IOfficeDataRange = category.Values
    'Set the value
    values.SetValue(3, 2, 120)
    values.SetValue(5, 2, 320)
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    IsFiltered

    Gets or sets the category filter.

    Declaration
    bool IsFiltered { get; set; }
    Property Value
    Type Description
    System.Boolean
    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()

    Name

    Gets the category name.Read-only.

    Declaration
    string Name { get; }
    Property Value
    Type Description
    System.String
    Examples
    IPresentation presentation = Presentation.Open("Template.pptx");
    ISlide slide = presentation.Slides[0];
    //Get the chart from slide
    IPresentationChart chart = slide.Shapes[0] as IPresentationChart;           
    //Get the category from the category collection
    IOfficeChartCategory category = chart.Categories[0];
    //Get the name of the category
    string name = category.Name;
    //Get the category label, read only
    IOfficeDataRange dataRange = category.CategoryLabel;
    //Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol");
    dataRange.SetValue(2, 4, 290);
    //Get the values of category
    IOfficeDataRange values = category.Values;
    //Set the value
    values.SetValue(3, 2, 120);
    values.SetValue(5, 2, 320);           
    //Save the presentation
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
    Dim slide As ISlide = presentation__1.Slides(0)
    'Get the chart from slide
    Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
    'Get the category from the category collection
    Dim category As IOfficeChartCategory = chart.Categories(0)
    'Get the name of the category
    Dim name As String = category.Name
    'Get the category label, read only
    Dim dataRange As IOfficeDataRange = category.CategoryLabel
    'Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol")
    dataRange.SetValue(2, 4, 290)
    'Get the values of category
    Dim values As IOfficeDataRange = category.Values
    'Set the value
    values.SetValue(3, 2, 120)
    values.SetValue(5, 2, 320)
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    Values

    Gets the category values.Read-only.

    Declaration
    IOfficeDataRange Values { get; }
    Property Value
    Type Description
    IOfficeDataRange
    Examples
    IPresentation presentation = Presentation.Open("Template.pptx");
    ISlide slide = presentation.Slides[0];
    //Get the chart from slide
    IPresentationChart chart = slide.Shapes[0] as IPresentationChart;           
    //Get the category from the category collection
    IOfficeChartCategory category = chart.Categories[0];
    //Get the name of the category
    string name = category.Name;
    //Get the category label, read only
    IOfficeDataRange dataRange = category.CategoryLabel;
    //Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol");
    dataRange.SetValue(2, 4, 290);
    //Get the values of category
    IOfficeDataRange values = category.Values;
    //Set the value
    values.SetValue(3, 2, 120);
    values.SetValue(5, 2, 320);           
    //Save the presentation
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    Dim presentation__1 As IPresentation = Presentation.Open("Template.pptx")
    Dim slide As ISlide = presentation__1.Slides(0)
    'Get the chart from slide
    Dim chart As IPresentationChart = TryCast(slide.Shapes(0), IPresentationChart)
    'Get the category from the category collection
    Dim category As IOfficeChartCategory = chart.Categories(0)
    'Get the name of the category
    Dim name As String = category.Name
    'Get the category label, read only
    Dim dataRange As IOfficeDataRange = category.CategoryLabel
    'Set the value
    dataRange.SetValue(2, 1, "2ndRow, 1stCol")
    dataRange.SetValue(2, 4, 290)
    'Get the values of category
    Dim values As IOfficeDataRange = category.Values
    'Set the value
    values.SetValue(3, 2, 120)
    values.SetValue(5, 2, 320)
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2023 Syncfusion Inc. All Rights Reserved