menu

Xamarin.Forms

  • Code Examples
  • Upgrade Guide
  • User Guide
  • Demos
  • Support
  • Forums
  • Download
Interface IOfficeChartDataPoints - Xamarin.Forms API Reference | Syncfusion

    Show / Hide Table of Contents

    Interface IOfficeChartDataPoints

    Represents a collection of data point in the series.

    Inherited Members
    IParentApplication.Parent
    Namespace: Syncfusion.OfficeChart
    Assembly: Syncfusion.OfficeChart.Portable.dll
    Syntax
    public interface IOfficeChartDataPoints : IParentApplication, IEnumerable

    Properties

    DefaultDataPoint

    Gets the default data points of the chart. Read-only.

    Declaration
    IOfficeChartDataPoint DefaultDataPoint { get; }
    Property Value
    Type
    IOfficeChartDataPoint
    Examples
    IPresentation presentation = Presentation.Create(); 
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Add chart to the slide with position and size
    IOfficeChart chart = slide.Charts.AddChart(100, 10, 500, 300);
    //Set chart data - Row1
    chart.ChartData.SetValue(1, 2, "Jan");
    chart.ChartData.SetValue(1, 3, "Feb");
    chart.ChartData.SetValue(1, 4, "March");
    //Set chart data - Row2
    chart.ChartData.SetValue(2, 1, "2011");
    chart.ChartData.SetValue(2, 2, "60");
    chart.ChartData.SetValue(2, 3, "70");
    chart.ChartData.SetValue(2, 4, "80");
    //Set chart data - Row3
    chart.ChartData.SetValue(3, 1, "2009");
    chart.ChartData.SetValue(3, 2, "80");
    chart.ChartData.SetValue(3, 3, "70");
    chart.ChartData.SetValue(3, 4, "60");
    //Set chart data - Row4
    chart.ChartData.SetValue(4, 1, "2010");
    chart.ChartData.SetValue(4, 2, "60");
    chart.ChartData.SetValue(4, 3, "70");
    chart.ChartData.SetValue(4, 4, "80");
    //Create a new chart series with the name
    IOfficeChartSerie serieJan = chart.Series.Add("Jan");
    //Set the data range of chart serie � start row, start column, end row, end column
    serieJan.Values = chart.ChartData[2, 2, 4, 2];
    //Create a new chart series with the name
    IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
    //Set the data range of chart serie � start row, start column, end row, end column
    serieFeb.Values = chart.ChartData[2, 3, 4, 3];
    //Create a new chart series with the name
    IOfficeChartSerie serieMarch = chart.Series.Add("March");
    //Set the data range of chart series � start row, start column, end row, end column
    serieMarch.Values = chart.ChartData[2, 4, 4, 4]; 
    //Get the series data points
    IOfficeChartDataPoints dataPoints = chart.Series[0].DataPoints;
    //Get the default data point, read only
    IOfficeChartDataPoint dataPoint = dataPoints.DefaultDataPoint;
    //Get the data labels of data point
    IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
    //Set the position of the data label
    dataLabels.Position = OfficeDataLabelPosition.Center;
    //Set the series name
    dataLabels.IsSeriesName = true;
    //Save the presentation
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    Dim presentation__1 As IPresentation = Presentation.Create()
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Add chart to the slide with position and size
    Dim chart As IOfficeChart = slide.Charts.AddChart(100, 10, 500, 300)
    'Set chart data - Row1
    chart.ChartData.SetValue(1, 2, "Jan")
    chart.ChartData.SetValue(1, 3, "Feb")
    chart.ChartData.SetValue(1, 4, "March")
    'Set chart data - Row2
    chart.ChartData.SetValue(2, 1, "2011")
    chart.ChartData.SetValue(2, 2, "60")
    chart.ChartData.SetValue(2, 3, "70")
    chart.ChartData.SetValue(2, 4, "80")
    'Set chart data - Row3
    chart.ChartData.SetValue(3, 1, "2009")
    chart.ChartData.SetValue(3, 2, "80")
    chart.ChartData.SetValue(3, 3, "70")
    chart.ChartData.SetValue(3, 4, "60")
    'Set chart data - Row4
    chart.ChartData.SetValue(4, 1, "2010")
    chart.ChartData.SetValue(4, 2, "60")
    chart.ChartData.SetValue(4, 3, "70")
    chart.ChartData.SetValue(4, 4, "80")
    'Create a new chart series with the name
    Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
    'Set the data range of chart serie � start row, start column, end row, end column
    serieJan.Values = chart.ChartData(2, 2, 4, 2)
    'Create a new chart series with the name
    Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
    'Set the data range of chart serie � start row, start column, end row, end column
    serieFeb.Values = chart.ChartData(2, 3, 4, 3)
    'Create a new chart series with the name
    Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
    'Set the data range of chart series � start row, start column, end row, end column
    serieMarch.Values = chart.ChartData(2, 4, 4, 4)
    'Get the series data points
    Dim dataPoints As IOfficeChartDataPoints = chart.Series(0).DataPoints
    'Get the default data point, read only
    Dim dataPoint As IOfficeChartDataPoint = dataPoints.DefaultDataPoint
    'Get the data labels of data point
    Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
    'Set the position of the data label
    dataLabels.Position = OfficeDataLabelPosition.Center
    'Set the series name
    dataLabels.IsSeriesName = True
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()

    Item[Int32]

    Gets single data point by its index. Read-only.

    Declaration
    IOfficeChartDataPoint this[int index] { get; }
    Parameters
    Type Name Description
    System.Int32 index
    Property Value
    Type
    IOfficeChartDataPoint
    Examples
    IPresentation presentation = Presentation.Create(); 
    ISlide slide = presentation.Slides.Add(SlideLayoutType.Blank);
    //Add chart to the slide with position and size
    IOfficeChart chart = slide.Charts.AddChart(100, 10, 500, 300);
    //Set chart data - Row1
    chart.ChartData.SetValue(1, 2, "Jan");
    chart.ChartData.SetValue(1, 3, "Feb");
    chart.ChartData.SetValue(1, 4, "March");
    //Set chart data - Row2
    chart.ChartData.SetValue(2, 1, "2011");
    chart.ChartData.SetValue(2, 2, "60");
    chart.ChartData.SetValue(2, 3, "70");
    chart.ChartData.SetValue(2, 4, "80");
    //Set chart data - Row3
    chart.ChartData.SetValue(3, 1, "2009");
    chart.ChartData.SetValue(3, 2, "80");
    chart.ChartData.SetValue(3, 3, "70");
    chart.ChartData.SetValue(3, 4, "60");
    //Set chart data - Row4
    chart.ChartData.SetValue(4, 1, "2010");
    chart.ChartData.SetValue(4, 2, "60");
    chart.ChartData.SetValue(4, 3, "70");
    chart.ChartData.SetValue(4, 4, "80");
    //Create a new chart series with the name
    IOfficeChartSerie serieJan = chart.Series.Add("Jan");
    //Set the data range of chart serie � start row, start column, end row, end column
    serieJan.Values = chart.ChartData[2, 2, 4, 2];
    //Create a new chart series with the name
    IOfficeChartSerie serieFeb = chart.Series.Add("Feb");
    //Set the data range of chart serie � start row, start column, end row, end column
    serieFeb.Values = chart.ChartData[2, 3, 4, 3];
    //Create a new chart series with the name
    IOfficeChartSerie serieMarch = chart.Series.Add("March");
    //Set the data range of chart series � start row, start column, end row, end column
    serieMarch.Values = chart.ChartData[2, 4, 4, 4]; 
    //Get the series data points
    IOfficeChartDataPoints dataPoints = chart.Series[0].DataPoints;
    //Get the data point using the index, read only
    IOfficeChartDataPoint dataPoint = dataPoints[0];
    //Get the data labels of data point
    IOfficeChartDataLabels dataLabels = dataPoint.DataLabels;
    //Set the position of the data label
    dataLabels.Position = OfficeDataLabelPosition.Center;
    //Set the series name
    dataLabels.IsSeriesName = true;
    //Save the presentation
    presentation.Save("Output.pptx");
    //Close the presentation
    presentation.Close();
    Dim presentation__1 As IPresentation = Presentation.Create()
    Dim slide As ISlide = presentation__1.Slides.Add(SlideLayoutType.Blank)
    'Add chart to the slide with position and size
    Dim chart As IOfficeChart = slide.Charts.AddChart(100, 10, 500, 300)
    'Set chart data - Row1
    chart.ChartData.SetValue(1, 2, "Jan")
    chart.ChartData.SetValue(1, 3, "Feb")
    chart.ChartData.SetValue(1, 4, "March")
    'Set chart data - Row2
    chart.ChartData.SetValue(2, 1, "2011")
    chart.ChartData.SetValue(2, 2, "60")
    chart.ChartData.SetValue(2, 3, "70")
    chart.ChartData.SetValue(2, 4, "80")
    'Set chart data - Row3
    chart.ChartData.SetValue(3, 1, "2009")
    chart.ChartData.SetValue(3, 2, "80")
    chart.ChartData.SetValue(3, 3, "70")
    chart.ChartData.SetValue(3, 4, "60")
    'Set chart data - Row4
    chart.ChartData.SetValue(4, 1, "2010")
    chart.ChartData.SetValue(4, 2, "60")
    chart.ChartData.SetValue(4, 3, "70")
    chart.ChartData.SetValue(4, 4, "80")
    'Create a new chart series with the name
    Dim serieJan As IOfficeChartSerie = chart.Series.Add("Jan")
    'Set the data range of chart serie � start row, start column, end row, end column
    serieJan.Values = chart.ChartData(2, 2, 4, 2)
    'Create a new chart series with the name
    Dim serieFeb As IOfficeChartSerie = chart.Series.Add("Feb")
    'Set the data range of chart serie � start row, start column, end row, end column
    serieFeb.Values = chart.ChartData(2, 3, 4, 3)
    'Create a new chart series with the name
    Dim serieMarch As IOfficeChartSerie = chart.Series.Add("March")
    'Set the data range of chart series � start row, start column, end row, end column
    serieMarch.Values = chart.ChartData(2, 4, 4, 4)
    'Get the series data points
    Dim dataPoints As IOfficeChartDataPoints = chart.Series(0).DataPoints
    'Get the data point using the index, read only
    Dim dataPoint As IOfficeChartDataPoint = dataPoints(0)
    'Get the data labels of data point
    Dim dataLabels As IOfficeChartDataLabels = dataPoint.DataLabels
    'Set the position of the data label
    dataLabels.Position = OfficeDataLabelPosition.Center
    'Set the series name
    dataLabels.IsSeriesName = True
    'Save the presentation
    presentation__1.Save("Output.pptx")
    'Close the presentation
    presentation__1.Close()
    Back to top Generated by DocFX
    Copyright © 2001 - 2025 Syncfusion Inc. All Rights Reserved