There are no detail docs on individual methods or properties.
I have been told that seriesMapping is the best way to proceed on charts.
In the code below some things work and some things don't:
The ToolTipLegend works.
Adding of "score" does not work.
The chart plots 18 values along the base line where I expect the values to show the hole score...
ChartPoints contains 18 occurances of ChartPoint
ChartPoint MyY is a score from -1 to 4
ChartPoint MyX is 1 through 18 (the 18 golf holes)
private class ChartPoint
{
public int MyY { get; set; }
public int MyX { get; set; }
}
private List<ChartPoint> ChartPoints = new List<ChartPoint>();
FatigueChart.Width = chartWidth;
FatigueChart.Height = chartHeight;
FatigueChart.DefaultView.ChartTitle.Content = "Fatigue";
//The legend takes up too much space. Remove it and make it appear as a tooltip...
ChartLegend toolTipLegend = new ChartLegend()
{
Background = new SolidColorBrush(Colors.Black),
Height = 200,
Width = 200,
};
ToolTip toolTip = new ToolTip()
{
Content = toolTipLegend,
Style = this.LayoutRoot.Resources["CustomToolTipStyle"] as Style,
};
ToolTipService.SetToolTip(FatigueChart, toolTip);
FatigueChart.DefaultView.ChartLegend.Visibility = Visibility.Collapsed;
FatigueChart.DefaultView.ChartArea.Legend = toolTipLegend;
SeriesMapping seriesMapping = new SeriesMapping();
seriesMapping.LegendLabel = "Fatigue Last 9 Games";
seriesMapping.SeriesDefinition = new SplineSeriesDefinition();
seriesMapping.ItemMappings.Add(new ItemMapping() //this didn't work
{
DataPointMember = DataPointMember.YValue,
FieldName = "Score"
});
FatigueChart.SeriesMappings.Add(seriesMapping);
FatigueChart.ItemsSource = chartPoints;
I think I just need to get started. What is wrong here?
Regards,
Gary