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

4 posts, 0 answers
  1. irem
    irem avatar
    5 posts
    Member since:
    Oct 2016

    Posted 21 Nov 2016 Link to this post

    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,

  2. Ves
    Admin
    Ves avatar
    2914 posts

    Posted 23 Nov 2016 Link to this post

    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
  3. irem
    irem avatar
    5 posts
    Member since:
    Oct 2016

    Posted 23 Nov 2016 in reply to Ves Link to this post

    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,

  4. Ves
    Admin
    Ves avatar
    2914 posts

    Posted 28 Nov 2016 Link to this post

    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
Back to Top