Need basic chart help

2 posts, 0 answers
  1. Gary Blakely
    Gary Blakely avatar
    63 posts
    Member since:
    Jan 2010

    Posted 23 Mar 2010 Link to this post

    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.ItemsSource = chartPoints;

    I think I just need to get started.  What is wrong here?

  2. Vladimir Milev
    Vladimir Milev avatar
    1061 posts

    Posted 25 Mar 2010 Link to this post

    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.
Back to Top