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

Set X axis labels

1 Answer 121 Views
ChartView
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Cameron
Top achievements
Rank 1
Cameron asked on 17 Jun 2012, 11:48 PM

Hello Telerik,

I'm in the process of migrating from the old Chart to ChartView. We have a requirement to set every X axis tick label. The old chart allows you to do that by iterating through the TickPoint collection of the X axis and set labels as follows: 

 foreach (var tc in ChartArea.AxisX.TickPoints)
 {
        string lable = GetLabel( tc.Value);

        tc.Label = label;
 }


Can I do the same with ChartView DateTimeContinuousAxis? If so, how? I don't see a class called TickPoint in ChartView reference material.

Thanks,

Cameron

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 20 Jun 2012, 07:59 AM
Hi Cameron,

The RadChart and the RadChartView are different controls and they do not have an equivalent for all features. You should also not expect them to have the same properties. To achieve the desired results you can set a template for the axis labels:
<telerik:DateTimeContinuousAxis>
 <telerik:DateTimeContinuousAxis.LabelTemplate>
  <DataTemplate>
   <TextBlock Text="{Binding}" />

Kind regards,
Petar Marchev
the Telerik team

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

Tags
ChartView
Asked by
Cameron
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or