RadChartView: Series Overview

The data visualization in RadChartView is done by a hierarchy of classes that inherit from the ChartSeries class. Each series has a collection of data items which provide the data. Concrete series types are available for specific charts. For example, there is a set of CartesianSeries applicable in the context of a RadCartesianChartView.

Abstract Series:

These are the base series that are extended by the actual series implementations in order to provide a clear level of abstraction and define more clearly the common features among the different series types.

CategoricalSeries

The CategoricalSeries is an abstract class which is extended by series which can present categorical data. This data needs category and value properties which determine the Cartesian coordinates of each data point.

Bindings

The CategoricalSeries class contains setCategoryBinding(DataPointBinding) and setValueBinding(DataPointBinding) methods which accept a DataPointBinding object as a parameter which defines the way the necessary information will be extracted from each data item. For example if our data item type is defined as follows:

    public class MonthResult {
        private String month;
        private double result;

        public MonthResult(String month, double result) {
            this.setMonth(month);
            this.setResult(result);
        }

        public double getResult() {
            return this.result;
        }

        public void setResult(double value) {
            this.result = value;
        }

        public String getMonth() {
            return this.month;
        }

        public void setMonth(String value) {
            this.month = value;
        }
    }
    public class MonthResult : Java.Lang.Object {

        public double Result { get; set; }
        public String Month { get; set; }

        public MonthResult(String month, double result) {
            this.Month = month;
            this.Result = result;
        }
    }

If we want to use the result of the data item as a value for our data points that will be visualized by the chart, we can define the DataPointBinding object for the value like this:

    DataPointBinding valueBinding = new PropertyNameDataPointBinding("Result");
    class MonthResultDataBinding : DataPointBinding {

        private string propertyName;

        public MonthResultDataBinding(string propertyName)
        {
            this.propertyName = propertyName;
        }

        public override Java.Lang.Object GetValue (Java.Lang.Object p0)
        {
            if(propertyName == "Month")
            {
                return ((MonthResult)(p0)).Month;
            }
            return ((MonthResult)(p0)).Result;
        }
    }

Similarly, if we want to use the month of the data item as a category for our data points that will be visualized by the chart, we can define the DataPointBinding object for the category like this:

    DataPointBinding categoryBinding = new PropertyNameDataPointBinding("Month");
    class MonthResultDataBinding : DataPointBinding {

        private string propertyName;

        public MonthResultDataBinding(string propertyName)
        {
            this.propertyName = propertyName;
        }

        public override Java.Lang.Object GetValue (Java.Lang.Object p0)
        {
            if(propertyName == "Month")
            {
                return ((MonthResult)(p0)).Month;
            }
            return ((MonthResult)(p0)).Result;
        }
    }

Then, we can use these objects with series that extend CategoricalSeries, for example LineSeries:

    LineSeries lineSeries = new LineSeries();
    lineSeries.setCategoryBinding(categoryBinding);
    lineSeries.setValueBinding(valueBinding);
    LineSeries lineSeries = new LineSeries();
    lineSeries.CategoryBinding = new MonthResultDataBinding ("Month");
    lineSeries.ValueBinding = new MonthResultDataBinding ("Result");

If you need to retrieve the current DataPointBinding objects for the value and category bindings, you can use the getValueBinding() and getCategoryBinding() respectively.

Combine Mode

When the series in a RadCartesianChartView are more than one, a few different drawing strategies can be used. The possible strategies are:

The default combine mode is None. You can get the current value through the getCombineMode() method and set a new value through setCombineMode(ChartSeriesCombineMode value). For example if you have two BarSeries, you need to set the combine mode to both of them if you want to make them stacked:

    barSeries1.setCombineMode(ChartSeriesCombineMode.STACK);
    barSeries2.setCombineMode(ChartSeriesCombineMode.STACK);
    barSeries1.CombineMode = ChartSeriesCombineMode.Stack;
    barSeries2.CombineMode = ChartSeriesCombineMode.Stack;

Here's how a chart with two BarSeries looks with the different combine modes:

TelerikUI-Chart-Series-CombineMode

RangeSeriesBase

The RangeSeriesBase is an abstract class which is extended by series which can present categorical data with more than one value property. The data needs not only category, but also 2 value properties: low value and high value. The series visaulize the whole range between the low value and the high value.

The binding mechanizm in RangeSeriesBase is the same as in CategoricalSeries. The methods that set the bindings are setCategoryBinding(DataPointBinding), setHighBinding(DataPointBinding) and setLowBinding(DataPointBinding). These series need two value bindings — low and high — in order to determine the start point and the end point of each data point.

RadCartesianChartView Series

RadCartesianChartView is a RadChartView which visualizes series as data points with Cartesian coordinates. Here is a list with the series types which provide data that can be plot on RadCartesianChartView:

RadPieChartView Series