This is a migrated thread and some comments may be shown as answers.

Chart Sum Function in BarSeries

1 Answer 63 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Michel
Top achievements
Rank 1
Michel asked on 13 Jun 2013, 02:07 PM
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

1 Answer, 1 is accepted

Sort by
0
Michel
Top achievements
Rank 1
answered on 14 Jun 2013, 09:46 AM
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
Tags
Chart
Asked by
Michel
Top achievements
Rank 1
Answers by
Michel
Top achievements
Rank 1
Share this question
or