Back to Devexpress

PolarChartSeriesClickEventArgs.Series Property

blazor-devexpress-dot-blazor-dot-polarchartseriesclickeventargs-1636bc37.md

latest3.7 KB
Original Source

PolarChartSeriesClickEventArgs.Series Property

Returns the clicked series.

Namespace : DevExpress.Blazor

Assembly : DevExpress.Blazor.v25.2.dll

NuGet Package : DevExpress.Blazor

Declaration

csharp
public IPolarChartSeries Series { get; }

Property Value

TypeDescription
IPolarChartSeries

The clicked series.

|

Remarks

The following code example displays the clicked point’s argument, value, and series name:

razor
<DxPolarChart Data=@DataSource 
              UseSpiderWeb="true"
              SeriesClick="OnClick">
    @foreach(var info in SeriesInfos) {
        <DxPolarChartLineSeries Name="@name" ArgumentField="@argumentField" ValueField="@valueField"/>
    }
</DxPolarChart>

@country produces @pointValue million tons of @fruit.

@code {
    string fruit;
    object pointValue, country;
    void OnClick(PolarChartSeriesClickEventArgs args) {
        if (args.Point != null) {
            fruit = args.Series.Name;
            pointValue = args.Point.Value;
            country = args.Point.Argument;
        }
    }

    public class SeriesInfo {
        public string Name { get; set; }
        public Expression<Func<SpiderPoint, object>> ValueField { get; set; }

        public SeriesInfo (string name, Expression<Func<SpiderPoint, object>> valueField) {
            Name = name;
            ValueField = valueField;
        }
    }

    IEnumerable<SeriesInfo> SeriesInfos = new List<SeriesInfo>() {
        new SeriesInfo("Apples", i => i.Apples),
        new SeriesInfo("Grapes", i => i.Grapes),
        new SeriesInfo("Lemons", i => i.Lemons),
        new SeriesInfo("Oranges", i => i.Oranges),
    };

    IEnumerable<SpiderPoint> DataSource = Enumerable.Empty<SpiderPoint>();

    protected override void OnInitialized () {
        DataSource = ChartSpiderDataProvider.GenerateData();
        SelectedSeries = SeriesTypes.FirstOrDefault();
    }
}
csharp
namespace BlazorDemo.Data {
    public class SpiderPoint {
        public string Arg { get; set; }
        public double Apples { get; set; }
        public double Grapes { get; set; }
        public double Lemons { get; set; }
        public double Oranges { get; set; }

        public SpiderPoint(string arg, double apples, double grapes, double lemons, double oranges) {
            Arg = arg;
            Apples = apples;
            Grapes = grapes;
            Lemons = lemons;
            Oranges = oranges;
        }
    }
}
csharp
using System.Collections.Generic;
using BlazorDemo.Data;

namespace BlazorDemo.DataProviders.Implementation {
    public class ChartSpiderDataProvider : IChartSpiderDataProvider {
        public List<SpiderPoint> GenerateData() {
            return new List<SpiderPoint>() {
                new SpiderPoint("USA", 4.21, 6.22, 0.8, 7.47),
                new SpiderPoint("China", 3.33, 8.65, 1.06, 5),
                new SpiderPoint("Turkey", 2.6, 4.25, 0.78, 1.71),
                new SpiderPoint("Italy", 2.2, 7.78, 0.52, 2.39),
                new SpiderPoint("India", 2.16, 2.26, 3.09, 6.26),
            };
        }
    }
}

See Also

PolarChartSeriesClickEventArgs Class

PolarChartSeriesClickEventArgs Members

DevExpress.Blazor Namespace