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

XAxis - Label position

2 Answers 31 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Nuno
Top achievements
Rank 1
Nuno asked on 18 Nov 2011, 11:09 PM
Hi,

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?

Thanks,
---------------------------

 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.SeriesMappings.Add(mapping);
                           radChart2.DefaultView.ChartArea.AxisX.LayoutMode = AxisLayoutMode.Inside;
                           radChart2.DefaultView.ChartArea.LabelFormatBehavior = LabelFormatBehavior.None;

2 Answers, 1 is accepted

Sort by
0
Nuno
Top achievements
Rank 1
answered on 22 Nov 2011, 10:24 PM
Anyone?
0
Sia
Telerik team
answered on 23 Nov 2011, 04:57 PM
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,
Sia
the Telerik team

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

Tags
Chart
Asked by
Nuno
Top achievements
Rank 1
Answers by
Nuno
Top achievements
Rank 1
Sia
Telerik team
Share this question
or