Chart Sum Function in BarSeries

2 posts, 0 answers
  1. Michel
    Michel avatar
    5 posts
    Member since:
    Jun 2013

    Posted 13 Jun 2013 Link to this post

    Hello,

    I'm implementing a RadCartesianChart with dynamic ChartDataSource and data sampling.
    Everything's fine but I'd like to sample via a sum function and not via the default average one.
    So I created a new SumBarSeries which inherits from BarSeries as shown below :

    public class SumBarSeries : BarSeries
    {
        protected override ChartAggregateFunction GetValueAggregateFunction()
        {
            return new ChartSumFunction();
        }
    }

    There's a min, max, average, keepextremes,  first and last function but no sum function.
    Is there a simple way to add such a function?
    Furthermore is it possible to change dynamically the sampling function just like the old RadCharts without changing the BarSeries class (ie. SumBarSeries)?

    Thanks,

    Michel LACOMBE
  2. Michel
    Michel avatar
    5 posts
    Member since:
    Jun 2013

    Posted 14 Jun 2013 Link to this post

    Hey,

    My sum function's working but I'm not sure it's the good way to implement the sum function.

    public class ChartSumFunction : ChartAggregateFunction
        {
            protected override string AggregateMethodName
            {
                get
                {
                    return "Sum";
                }
            }     
        }

    Thanks for your feedback
  3. UI for WPF is Visual Studio 2017 Ready
Back to Top