cbg3 Posted May 1, 2008 Report Share Posted May 1, 2008 I have a list of objects, named EmailCampaign, as the datasource of a bar chart. The objects include two properties: EmailsSent (int), and ContentType (string). The value of the ContentType property can be "Newsletter", "Concept Piece", and others. What I want the bar chart to show is the aggregates of all the EmailsSent property values, with a different bar for each distinct value of the ContentType property. How can I accomplish this? Thanks, --Ben Quote Link to comment Share on other sites More sharing options...
cbg3 Posted May 6, 2008 Author Report Share Posted May 6, 2008 Here is some sample data to show what I'm trying to accomplish: class EmailCampaign{ private int emailsSent; public int EmailsSent { get { return emailsSent; } } private string contentType; public string ContentType { get { return contentType; } } public EmailCampaign(int emailsSent, string contentType) { this.emailsSent = emailsSent; this.contentType = contentType; }} EmailCampaign[] emailCampaigns = new EmailCampaign[4];emailCampaigns[0] = new EmailCampaign(1, "Concept Piece");emailCampaigns[1] = new EmailCampaign(3, "Newsletter");emailCampaigns[2] = new EmailCampaign(4, "Newsletter");emailCampaigns[3] = new EmailCampaign(4, "Concept Piece"); As you can see, summing the values of the EmailsSent property for all the EmailCampaign instances where the value of the ContentType property is "Concept Piece" totals 5, and where the value is "Newsletter" totals 7. What I want to do somehow is to create a bar chart using the emailCampaigns array as a datasource that would in this case have one bar, labeled "Concept Piece," with a height of 5, and another bar, labeled "Newsletter" with a height of 7. Quote Link to comment Share on other sites More sharing options...
Frank Posted May 6, 2008 Report Share Posted May 6, 2008 Chart FX doesn't aggregate data, you will need to aggregate this data before passing it to the chart. Quote Link to comment Share on other sites More sharing options...
cbg3 Posted May 7, 2008 Author Report Share Posted May 7, 2008 OK, thanks for confirming this, Francisco. Is there someplace I could put this in as a ChartFX feature request? --Ben Quote Link to comment Share on other sites More sharing options...
Recommended Posts
Join the conversation
You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.