Xamarin iOS label TextColor for individual Axis

5 posts, 0 answers
  1. Karles
    Karles avatar
    2 posts
    Member since:
    May 2017

    Posted 29 Aug Link to this post

    hi,

    I use Xamarin IOs and telerik to make a ("Chart Series: Line"), I'm trying to display some labels with a certain TextColor and other labels with another TextColor.

    I tried Chart.YAxis.Style.LabelStyle.TextColor, but that changes the color for all labels. 

    I tried AttributedTextForAxis, but this seems that only returns a string, and y need the textColor of the AttributedText. 

    I need help to solve this.

    Thanks!
  2. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 01 Sep Link to this post

    Hello Karles,

    You can find an example on how to style the labels of the series on the iOS platform in the "Examples" application which is located in the Examples/iOS folder of your local Telerik UI for Xamarin installation. Please have a look at the CustomPointLabel demo and its implementation as you should be able to achieve the behavior in the same manner.

    Regards,
    Stefan Nenchev
    Progress Telerik
    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. Karles
    Karles avatar
    2 posts
    Member since:
    May 2017

    Posted 09 Sep in reply to Stefan Nenchev Link to this post

    Hello,

    Stefan can you explain a bit more how can i utilize the example to custom the axis labels?

    i need to put the negative values with a red color.

    in this moments i use a custom axis but now i can't get the size between the axis, how can i get it? or this is a bad way to custom the axis labels?

    thx

  4. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 13 Sep Link to this post

    Hello Karles,

    Please excuse me for referencing that example as it is regarding the labels of the points within the series. 
    As for the labels on the axis, I will have a look whether this is possible with the current implementation and update the thread once I have more information. 

    Regards,
    Stefan Nenchev
    Progress Telerik
    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
  5. Stefan Nenchev
    Admin
    Stefan Nenchev avatar
    503 posts

    Posted 17 Sep Link to this post

    Hello Karles,

    Unfortunately, it would not be possible to achieve your requirement with the current implementation of the control. I have logged a feature request so we can consider exposing the functionality in Xamarin.Forms. You can track its progress here - Chart: Change color of individual label on axis. I suggest you follow the item in order to receive notification when some updates are available. I have also added some points to your account for the suggestion.

    Regards,
    Stefan Nenchev
    Progress Telerik
    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