This question is locked. New answers and comments are not allowed.
Hello, I am evaluating the Silverlight controls and am trying to create a line chart. I am having problems similar to this thread:
http://www.telerik.com/community/forums/silverlight/chart/adding-1-month-intervals-to-chart-x-axis-range.aspx.
I would like my x-axis data labels to line up with the actual data points, as is shown in the attached image. However, as soon as I declare the actual date field as the value for the x-axis, the data points become dis-aligned and I end up with a gap on the right side of the chart.
I believe the solution is to follow the response of the above thread, which was to manually change the value of the tickpoints, however, it does not state how to do this.
I tried something like this, but it is not working at all:
for (int i=0;i<radChart.DefaultView.ChartArea.AxisX.TickPoints.Count;i++)
{
radChart.DefaultView.ChartArea.AxisX.TickPoints[i].Label = ((DateTime)e.Result[i].stat_date).ToString("MMM-YY");
}
Any assistance would be welcome. Thank you.
Chart code:
<
telerik:RadChart
x:Name
=
"RadChart1"
>
<
telerik:RadChart.DefaultSeriesDefinition
>
<
telerik:LineSeriesDefinition
/>
</
telerik:RadChart.DefaultSeriesDefinition
>
<
telerik:RadChart.DefaultView
>
<
telerik:ChartDefaultView
>
<
telerik:ChartDefaultView.ChartArea
>
<
telerik:ChartArea
LabelFormatBehavior
=
"None"
>
<
telerik:ChartArea.AxisX
>
<
telerik:AxisX
IsDateTime
=
"False"
AutoRange
=
"True"
>
</
telerik:AxisX
>
</
telerik:ChartArea.AxisX
>
</
telerik:ChartArea
>
</
telerik:ChartDefaultView.ChartArea
>
</
telerik:ChartDefaultView
>
</
telerik:RadChart.DefaultView
>
<
telerik:RadChart.SeriesMappings
>
<
telerik:SeriesMapping
>
<
telerik:SeriesMapping.ItemMappings
>
<
telerik:ItemMapping
FieldName
=
"new_registrants"
DataPointMember
=
"YValue"
/>
</
telerik:SeriesMapping.ItemMappings
>
</
telerik:SeriesMapping
>
</
telerik:RadChart.SeriesMappings
>
</
telerik:RadChart
>