The helper class and code pasted below create a horizontal100bar chart that looks OK except that the left axis does not have the desired label which is a string containg a date contained in the "Played" field. The line that is commented out is an attempt to insert the dates played as a label on the left YAxis but when included completely messes up the chart. How can I get the Played values (always 9 of them) to appear on the left?
By the way, If I only show the Birds, the played series prints just fine.
Thanks, Gary
(a .png of the graph produced is attached)
public class SummarySet
{
public SummarySet(string played, string birds, string pars, string bgys, string dbls, string trpls, string othrs)
{
this.Played = played;
this.Birds = birds;
this.Pars = pars;
this.Bgys = bgys;
this.Dbls = dbls;
this.Trpls = trpls;
this.Othrs = othrs;
}
public string Played { get; set; }
public string Birds { get; set; }
public string Pars { get; set; }
public string Bgys { get; set; }
public string Dbls { get; set; }
public string Trpls { get; set; }
public string Othrs { get; set; }
}
SummaryChart.Width = chartWidth * 1.5;
SummaryChart.Height = chartHeight;
SummaryChart.DefaultView.ChartTitle.Content = "Summary Last 9 Games";
SeriesMapping sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Birds" });
//sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.XCategory, FieldName = "Played" });
sm.LegendLabel = "Birdies";
SummaryChart.SeriesMappings.Add(sm);
sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Pars" });
sm.LegendLabel = "Pars";
SummaryChart.SeriesMappings.Add(sm);
sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Bgys" });
sm.LegendLabel = "Bogeys";
SummaryChart.SeriesMappings.Add(sm);
sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Dbls" });
sm.LegendLabel = "Doubles";
SummaryChart.SeriesMappings.Add(sm);
sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Trpls" });
sm.LegendLabel = "Triples";
SummaryChart.SeriesMappings.Add(sm);
sm = new SeriesMapping();
sm.SeriesDefinition = new HorizontalStackedBar100SeriesDefinition();
sm.ItemMappings.Add(new ItemMapping() { DataPointMember = DataPointMember.YValue, FieldName = "Othrs" });
sm.LegendLabel = "Others";
SummaryChart.SeriesMappings.Add(sm);
SummaryChart.ItemsSource = data;