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

How to remove space between to 0-January in X axis ?

1 Answer 51 Views
Chart
This is a migrated thread and some comments may be shown as answers.
Saravanan
Top achievements
Rank 1
Saravanan asked on 29 Aug 2011, 02:29 PM
Hi team,
  
i am binding month names (Jan,Feb.etc) in X axis from database,i am seeing space between 0 to January .please help me to remove space
here is my xaml code
 <telerik:RadChart x:Name="RadChart1" ItemsSource="{Binding ChartItems}">
            <telerik:RadChart.DefaultView>
                <telerik:ChartDefaultView>
                    <telerik:ChartDefaultView.ChartArea>
                        <telerik:ChartArea LegendName="legend">
                            <telerik:ChartArea.AxisY>
                                <telerik:AxisY AutoRange="False"
                                        MinorTicksVisibility="Collapsed">
                                </telerik:AxisY>
                            </telerik:ChartArea.AxisY>
                        </telerik:ChartArea>
                    </telerik:ChartDefaultView.ChartArea>
                    <telerik:ChartDefaultView.ChartLegend>
                        <telerik:ChartLegend x:Name="legend" />
                    </telerik:ChartDefaultView.ChartLegend>
                </telerik:ChartDefaultView>
            </telerik:RadChart.DefaultView>
            <telerik:RadChart.SeriesMappings>
                
                <telerik:SeriesMapping LegendLabel="customers travelled"
                        CollectionIndex="0">
                    <telerik:SeriesMapping.SeriesDefinition>
                        <telerik:SplineSeriesDefinition />
                    </telerik:SeriesMapping.SeriesDefinition>
                    <telerik:ItemMapping DataPointMember="XCategory"
                            FieldName="{Binding Month}" />
                    <telerik:ItemMapping DataPointMember="YValue"
                            FieldName="{Binding vRR}" />
                </telerik:SeriesMapping>
            </telerik:RadChart.SeriesMappings>
        </telerik:RadChart>
  
public class ChartValues
    {
         public double? vRR { get; set; }
                      public string Month { get; set; }
    }
  
here i am binding months from database
  
  
 foreach (var itemValue in item)
                        {
                            double data = itemValue.Sum(t => t.NumericValue);
                            cv = new ChartValues();
                            cv.vRR = data;
                            cv.Month = Convert.ToString(itemValue.First().Timestamp.ToString("MMM"));
                             ChartItems.Add(cv);
  
  
                        }
  
i have attached the screen shot,please find the attachement here.

1 Answer, 1 is accepted

Sort by
0
Nikolay
Telerik team
answered on 01 Sep 2011, 07:42 AM
Hello Saravanan,

It appears that the Axis Layout property has been set to Inside, which is why the Spline series does not begin from the chart origin. Setting the X-Axis Layout to Normal/Auto should remove the spaces.

You can see how the Axis Layout property works in this demo example. More information on the feature here

Best wishes,
Nikolay
the Telerik team

Thank you for being the most amazing .NET community! Your unfailing support is what helps us charge forward! We'd appreciate your vote for Telerik in this year's DevProConnections Awards. We are competing in mind-blowing 20 categories and every vote counts! VOTE for Telerik NOW >>

Tags
Chart
Asked by
Saravanan
Top achievements
Rank 1
Answers by
Nikolay
Telerik team
Share this question
or