This is a migrated thread and some comments may be shown as answers.

Need basic chart help

1 Answer 38 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Gary Blakely
Top achievements
Rank 1
Gary Blakely asked on 23 Mar 2010, 10:35 PM
Downloaded your PDF and projects - your chart project that uses seriesmapping won't compile. 
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

1 Answer, 1 is accepted

Sort by
0
Vladimir Milev
Telerik team
answered on 25 Mar 2010, 08:56 PM
Hi Gary Blakely,

To learn about RadChart databinding please check this help topic and this example. Let us know if these help and if you have further questions.

Sincerely yours,
Vladimir Milev
the Telerik team

Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Public Issue Tracking system and vote to affect the priority of the items.
Tags
Chart
Asked by
Gary Blakely
Top achievements
Rank 1
Answers by
Vladimir Milev
Telerik team
Share this question
or