Jump to content
Software FX Community

cbg3

Members
  • Posts

    6
  • Joined

  • Last visited

Everything posted by cbg3

  1. OK, thanks for confirming this, Francisco. Is there someplace I could put this in as a ChartFX feature request? --Ben
  2. 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.
  3. 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
  4. Hi again, After moving things around a bit in my code, I found that it seems order is important, and also figured out some things about series and points. Now I am able to get the data from the properties I want and not show the ones I don't. Still, the FieldMap.DisplayName is being ignored. ---- Email[] emails = new Email[3];emails[0] = new Email(50, 12, 23, 99);emails[1] = new Email(30, 12, 23, 99);emails[2] = new Email(40, 2, 4, 99);chart4.DataSource = emails;chart4.Gallery = Gallery.Bar;chart4.DataSourceSettings.Fields.Clear();FieldMap fieldMap;fieldMap = new FieldMap();fieldMap.Name = "EmailSetSize";fieldMap.DisplayName = "Emails Sent";fieldMap.Usage = FieldUsage.XValue;chart4.DataSourceSettings.Fields.Add(fieldMap);fieldMap = new FieldMap();fieldMap.Name = "OptedOutSetSize";fieldMap.DisplayName = "Opt Outs";fieldMap.Usage = FieldUsage.XValue;chart4.DataSourceSettings.Fields.Add(fieldMap);fieldMap = new FieldMap();fieldMap.Name = "BadSetSize";fieldMap.DisplayName = "Bounces";fieldMap.Usage = FieldUsage.XValue;chart4.DataSourceSettings.Fields.Add(fieldMap);chart4.Data.Series = chart4.DataSourceSettings.Fields.Count;chart4.Data.Points = chart4.DataSourceSettings.Fields.Count;class Email{ private int emailSetSize; public int EmailSetSize { get { return emailSetSize; } } private int badMailSetSize; public int BadSetSize { get { return badMailSetSize; } } private int optedOutSetSize; public int OptedOutSetSize { get { return optedOutSetSize; } } private int irrelevantProperty; public int IrrelevantProperty { get { return irrelevantProperty; } } public Email(int emailSetSize, int badMailSetSize, int optedOutSetSize, int irrelevantProperty) { this.emailSetSize = emailSetSize; this.badMailSetSize = badMailSetSize; this.optedOutSetSize = optedOutSetSize; this.irrelevantProperty = irrelevantProperty; }}
  5. As the title suggests, I have a business object that has a number of public properties on it, some of which I want to display in a Bar chart, and others I do not. The values of the properties I do want to display should be aggregated from the n series of business objects I hand to the chart's DataSource property, with the sum of each property displayed in a column in the Bar chart. Thus, if each instance of the business object has 3 properties I want to display, the Bar chart should have 3 columns. The code I'm using is below. The issues I'm experiencing are that each series of data produces a new column in the bar chart, which is not what I want. The DisplayNames I specify for the FieldMaps are being ignored. Lastly, the property I don't want displayed, IrrelevantProperty, is being displayed. Thanks for your support. --------------- chart1.Data.Series = 1; chart1.Data.Points = 3; Email[] emails = new Email[3]; emails[0] = new Email(50, 12, 23, 99); emails[1] = new Email(30, 12, 23, 99); emails[2] = new Email(40, 2, 4, 99); chart1.DataSource = emails; chart1.Gallery = Gallery.Bar; chart1.DataSourceSettings.Fields.Clear(); fieldMap = new FieldMap(); fieldMap.Name = "EmailSetSize"; fieldMap.DisplayName = "Emails Sent"; fieldMap.Usage = FieldUsage.XValue; chart1.DataSourceSettings.Fields.Add(fieldMap); fieldMap = new FieldMap(); fieldMap.Name = "OptedOutSetSize"; fieldMap.DisplayName = "Opt Outs"; fieldMap.Usage = FieldUsage.XValue; chart1.DataSourceSettings.Fields.Add(fieldMap); fieldMap = new FieldMap(); fieldMap.Name = "BadSetSize"; fieldMap.DisplayName = "Bounces"; fieldMap.Usage = FieldUsage.XValue; chart1.DataSourceSettings.Fields.Add(fieldMap); fieldMap = new FieldMap(); fieldMap.Name = "IrrelevantProperty"; fieldMap.Usage = FieldUsage.NotUsed; chart1.DataSourceSettings.Fields.Add(fieldMap); class Email { private int emailSetSize; public int EmailSetSize { get { return emailSetSize; } } private int badMailSetSize; public int BadSetSize { get { return badMailSetSize; } } private int optedOutSetSize; public int OptedOutSetSize { get { return optedOutSetSize; } } private int irrelevantProperty; public int IrrelevantProperty { get { return irrelevantProperty; } } public Email(int emailSetSize, int badMailSetSize, int optedOutSetSize, int irrelevantProperty) { this.emailSetSize = emailSetSize; this.badMailSetSize = badMailSetSize; this.optedOutSetSize = optedOutSetSize; this.irrelevantProperty = irrelevantProperty; } }
×
×
  • Create New...