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

RadCartesianChart / VerticalAxis / Is it possible to use converter for LabelFormat ?

3 Answers 176 Views
Chart
This is a migrated thread and some comments may be shown as answers.
irem
Top achievements
Rank 1
irem asked on 21 Nov 2016, 07:29 AM

Hi,

I am trying to display vertical axis labels as formatted. I want to display numbers ( thounds, billions and millions ) like as 12K, 2M, 3B. I have written a number converter. But the problem is; which property should be used for binding ?

There is not a property like as Label . So, what do you suggest me to apply my converter for labelformat ??

  <telerikChart:RadCartesianChart.VerticalAxis>
                  <telerikChart:NumericalAxis x:Name="VerticalAxis"
                                              LabelFormat="{Binding ????, Converter={StaticResource NumberConverter}}"
                                              BindingContext="{TemplateBinding BindingContext}"
                                              Minimum="{Binding MinValue}"
                                              Maximum="{Binding MaxValue}"/>
  </telerikChart:RadCartesianChart.VerticalAxis>

Thanks in advance,

3 Answers, 1 is accepted

Sort by
0
Ves
Telerik team
answered on 23 Nov 2016, 11:49 AM
Hi irem,

LabelFormat can only be statically set -- it would be the same for all the labels and if a converter is added as you have shown, it would not be utilized to format each label, but it would act as a regular value converter -- it should return a string value to be used as label format.

Best regards,
Ves
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
0
irem
Top achievements
Rank 1
answered on 23 Nov 2016, 01:31 PM

Hi Ves,

Thanks for your response. But I could not understand the solution of my problem clearly. Can I display the numbers as formatted like as 12K, 2M, 5B on the vertical axis? My NumberConverter returns string value, but the problem is which property should be used for binding ?? 

Thanks,

0
Ves
Telerik team
answered on 28 Nov 2016, 12:36 PM
Hi irem,

It is not possible to have separate formatting for each label i.e. you cannot plug a formatter, which would provide a different format for each individual label.

Best regards,
Ves
Telerik by Progress
Do you want to have your say when we set our development plans? Do you want to know when a feature you care about is added or when a bug fixed? Explore the Telerik Feedback Portal and vote to affect the priority of the items
Tags
Chart
Asked by
irem
Top achievements
Rank 1
Answers by
Ves
Telerik team
irem
Top achievements
Rank 1
Share this question
or