We use cookies to give you the best experience on our website. If you continue to browse, then you agree to our privacy policy and cookie policy.
Unfortunately, activation email could not send to your email. Please try again.

Aggregating Data into Chart

Thread ID:

Created:

Updated:

Platform:

Replies:

118350 Feb 28,2015 11:49 AM Mar 3,2015 08:11 AM WPF 3
loading
Tags: Chart
David Crumb
Asked On February 28, 2015 11:49 AM

Say hypothetically speaking that I have a Data Model which tracks items sold by date, type, and items sold:
(note: this code was adapted from your own examples)

public SalesViewModel()
        {
            this.Sales = new ObservableCollection<SalesDataModel>();
            this.Sales .Add(new SalesDataModel() { Date = "01/01/2014", ProductName = "Shirt", ItemsSold= 31 });
            this.Sales .Add(new SalesDataModel() { Date = "01/01/2014", ProductName = "Shoes", ItemsSold = 15 });
            this.Sales .Add(new SalesDataModel() { Date = "01/02/2014", ProductName = "Shirt", ItemsSold = 7 });
            this.Sales .Add(new SalesDataModel() { Date = "01/02/2014", ProductName = "Shoes", ItemsSold = 3 });
            this.Sales .Add(new SalesDataModel() { Date = "02/01/2014", ProductName = "Shirt", ItemsSold = 10 });
            this.Sales .Add(new SalesDataModel() { Date = "02/01/2014", ProductName = "Shoes", ItemsSold = 6 });
            this.Sales .Add(new SalesDataModel() { Date = "03/01/2014", ProductName = "Shirt", ItemsSold = 10 });
            this.Sales .Add(new SalesDataModel() { Date = "03/01/2014", ProductName = "Shoes", ItemsSold= 10 });
        }

And say I wanted to have a chart where on the XAxis, I wanted Month("Jan","Feb" etc) and on the Y axis, a sum of the Items Sold.
OR if I wanted on the X axis to have Product Name(Shirts or Shoes) and Y axis total of items sold

Advice greatly appreciated,

--Dave

ps:  Maybe Im missing something, but is there such a thing as a Bar Chart API (not a chart api, but an api available for each control) which all of the features and parameters available to that control?

Thanks




Rachel A [Syncfusion]
Replied On March 2, 2015 08:41 AM

Hi David,

Thank you for using Syncfusion products.

We have achieved your requirement by grouping the data points based on ProductName and calculated the sum of the ItemsSold .We have prepared the sample based on your requirement and please find the sample in the below location.

Sample: Aggregate_Chart.zip

Is there such a thing as a Bar Chart API (not a chart api, but an api available for each control) which all of the features and parameters available to that control?

We are unable to get your exact requirement and we suspect that you requirement is to know about the API of SfChart features. You can find that from our class reference documentation from the below link.

Class Reference Link

Note: If this is not your exact requirement, please provide more information on your requirement. So that we can provide you the better solution.

Please let us know if you require any further assistance.

Thanks,

Rachel. A



David Crumb
Replied On March 2, 2015 04:00 PM

Rachel;

Thank you for the solution.  In my limited humble opinion, this seems like a very cumbersome process for something that seems fundamental to charting, but I digress.

As far as the Class Reference Link, I'm looking for each control that I subscribe to, what are the features available for each (WPF) control, and what options are available for each parameter.  I see it limited in the help.syncfusion.com/wpf  Where they "Getting Started" and changing a feature at a time (which is very helpful getting started).

Help appreciated,

--Dave


Rachel A [Syncfusion]
Replied On March 3, 2015 08:11 AM

Hi David,

Thank you for your response.

We have already logged the aggregating data to the chart as a feature request and we will be implementing this feature in any of our upcoming volume releases.

You can find the SfChart classes and properties from our Class Reference documentation from the below link. We are in the process of enriching our UG documentation and we will refresh full documentations in upcoming releases.

Link: http://help.syncfusion.com/cr/wpf/sfchart

Please let us know if you require any further assistance.

Thanks,

Rachel. A



CONFIRMATION

This post will be permanently deleted. Are you sure you want to continue?

Sorry, An error occured while processing your request. Please try again later.

You are using an outdated version of Internet Explorer that may not display all features of this and other websites. Upgrade to Internet Explorer 8 or newer for a better experience.

;