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

Multiple Y Axis percentage point labels

1 Answer 97 Views
Chart
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
MacKenzie Mickelsen
Top achievements
Rank 1
MacKenzie Mickelsen asked on 02 Apr 2012, 09:43 PM
Hello All

 I have having a problem getting a series point labels to show up correctly when we have multiple Y-Axises. Currently what I am doing is creating a new AxisY object and setting it's properties. I set the DefaultLabelFormat to "0.00%" This causes the new Y-Axis's Tick values to show up correctly formatted (i.e. 10.00%, 20.00%, and so on) but the point labels show up 0.10 or 0.67. Am I doing something wrong? I tried setting the item default label property on the mapping object but to no avail. 

Any help or suggestions would be most appreciated.

Thanks in advance
MacK

1 Answer, 1 is accepted

Sort by
0
Petar Marchev
Telerik team
answered on 03 Apr 2012, 09:10 AM
Hello,

Have you also set the ItemLabelFormat property of the series definition?

The code below should work for both the labels in the additional Y axis and the labels of the items in the series:
<telerik:RadChart x:Name="RadChart1" >
 <telerik:RadChart.SeriesMappings>
  <telerik:SeriesMapping>
   <telerik:SeriesMapping.SeriesDefinition>
    <telerik:LineSeriesDefinition ItemLabelFormat="0.00%" />
   </telerik:SeriesMapping.SeriesDefinition>
   <telerik:ItemMapping DataPointMember="YValue" FieldName="" />
  </telerik:SeriesMapping>
 </telerik:RadChart.SeriesMappings>
 <telerik:RadChart.DefaultView>
  <telerik:ChartDefaultView>
   <telerik:ChartDefaultView.ChartArea>
    <telerik:ChartArea>
     <telerik:ChartArea.AdditionalYAxes>
      <telerik:AxisY DefaultLabelFormat="0.00%" />
     </telerik:ChartArea.AdditionalYAxes>
    </telerik:ChartArea>
   </telerik:ChartDefaultView.ChartArea>
  </telerik:ChartDefaultView>
 </telerik:RadChart.DefaultView>
</telerik:RadChart>

public MainPage()
{
  InitializeComponent();
  this.RadChart1.ItemsSource = new double[] { 0.0005, 0.0016, 0.0014, 0.0011, 0.0010, 0.0005};
}

Regards,
Petar Marchev
the Telerik team
Sharpen your .NET Ninja skills! Attend Q1 webinar week and get a chance to win a license! Book your seat now >>
Tags
Chart
Asked by
MacKenzie Mickelsen
Top achievements
Rank 1
Answers by
Petar Marchev
Telerik team
Share this question
or