XAxis - Label position

3 posts, 0 answers
  1. Nuno
    Nuno avatar
    6 posts
    Member since:
    Sep 2012

    Posted 18 Nov 2011 Link to this post


    I'm using a domain service to populate a Radchart.
    The problem i'm facing is that the label position on the XAxis is incorrect. It's not centered.
    As you can see in the picture, the first column should have value "100, however the label is shown outside the chart....
    How can i center this labels?


     ChartArea ca = (ChartArea)senderObj;
                foreach (DataPoint p in ca.SelectedItems)
                   int monthdetail = (int)p.XValue;
                   InvokeOperation<Dictionary<string, int>> MonthFamily = dbcontext.GetTestCaseResultsByFamily(monthdetail);
                   MonthFamily.Completed += (sender, args) =>
                           if (MonthFamily.Error == null)
                               List<TestsByFamily> testsbyfamily = new List<TestsByFamily>();
                               SeriesMapping seriesMapping = new SeriesMapping();
                               seriesMapping.SeriesDefinition = new BarSeriesDefinition();
                               radChart2.DefaultView.ChartArea.NoDataString = "Click on the chart above to see the tests by family";
                               foreach (var monthFamily in MonthFamily.Value)
                                    testsbyfamily.Add(new TestsByFamily(monthFamily.Key,monthFamily.Value));
                               this.radChart2.ItemsSource = testsbyfamily;
                               ISeriesDefinition definition = new BarSeriesDefinition()
                                   LegendDisplayMode = LegendDisplayMode.DataPointLabel,
                                   ShowItemToolTips = true
                               SeriesMapping mapping = new SeriesMapping()
                                   SeriesDefinition = definition
                               mapping.ItemMappings.Add(new ItemMapping()
                                   DataPointMember = DataPointMember.XCategory,
                                   FieldName = "Family"
                               mapping.ItemMappings.Add(new ItemMapping()
                                   DataPointMember = DataPointMember.YValue,
                                   FieldName = "TotalByMonth"
                               radChart2.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
                               radChart2.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.None;
  2. Nuno
    Nuno avatar
    6 posts
    Member since:
    Sep 2012

    Posted 22 Nov 2011 Link to this post

  3. Sia
    Sia avatar
    756 posts

    Posted 23 Nov 2011 Link to this post

    Hello Nuno,

    Such behavior is not expected and we have not received similar reports.
    Can you please isolate that problem in a small runnable project and send it to us? In that way we will be able to debug it locally and give you more specific advice.

    Thank you in advance,
    the Telerik team

    Explore the entire Telerik portfolio by downloading the Ultimate Collection trial package. Get it now >>

Back to Top