Skip to main content

DXSeries.Data Property

Gets or sets data the series display on the Chart.

Namespace: DevExpress.Xamarin.iOS.Charts

Assembly: DevExpress.Xamarin.iOS.Charts.dll

NuGet Package: DevExpress.XamarinForms.Charts

Declaration

public virtual IDXSeriesData Data { get; set; }

Property Value

Type Description
IDXSeriesData

The data the series display on the Chart.

Remarks

The primary series task is to provide data the DXChart displays. A series utilizes one of the following classes as its Data property value to load data:

Data interface

Description

DXQualitativeSeriesData

DXWeightedQualitativeSeriesData

The DXBubbleSeries series requires this data class.

DXNumericSeriesData

DXWeightedNumericSeriesData

The DXBubbleSeries series requires this data class.

DXDateTimeSeriesData

DXWeightedDateTimeSeriesData

The DXBubbleSeries series requires this data class.

DXFinancialSeriesData

The DXStockSeries and DXCandleStickSeries series require this data interface. Note that all series point values equal zero when you use this data class with other series types.

DXCalculatedSeriesData

The DXCalculatedSeries ancestors require this data class.

Important

The data class the series uses should be compatible with the type of object assigned to the DXChart.AxisX property; otherwise, the Chart does not display the series. The Chart view creates an axis that is compatible with the first series’ data class if you do not specify its AxisX property value.

Example

This example demonstrates how to implement the adapter of a model object collection to a qualitative series data:

// In the ViewDidLoad method.
List<SaleItemCategory> devAVSalesByCategory = new List<SaleItemCategory> {
    new SaleItemCategory("Cameras", 472911.89),
    new SaleItemCategory("Cell Phones", 339264.52),
    new SaleItemCategory("Computers", 259316.93),
    new SaleItemCategory("TV, Audio", 360842.07),
    new SaleItemCategory("Vehicle Electronics", 257307.88),
    new SaleItemCategory("Multipurpose Batteries", 585647.96)
};

this.chart.AddSeries(
    new DXBarSeries {
        DisplayName = "DevAV Central",
        Data = new CategoryListToQualitativeSeriesDataAdapter(devAVSalesByCategory)
    }
);
// ...

class CategoryListToQualitativeSeriesDataAdapter: DXQualitativeSeriesData {
    List<SaleItemCategory> adaptee;

    public CategoryListToQualitativeSeriesDataAdapter(List<SaleItemCategory> list) {
        adaptee = list;
    }

    public override int DataCount => (adaptee != null) ? adaptee.Count : 0;
    public override string GetArgumentByIndex(int index) => adaptee[index].Name;
    public override double GetValueByIndex(int index) => adaptee[index].Income;
}

class SaleItemCategory {
    public string Name { get; }
    public double Income { get; }

    public SaleItemCategory(string name, double income) {
        Name = name;
        Income = income;
    }
}

The code above uses the classes and members below:

Symbol

Description

DXBarSeries

Displays data as individual bars, grouped by arguments, whose values determine each bar’s height.

DXSeries.Data

Gets or sets data the series display on the Chart.

DXQualitativeSeriesData

See Also