How to draw the needle on top

7 posts, 0 answers
  1. krystian
    krystian avatar
    4 posts
    Member since:
    Jan 2017

    Posted 19 Feb 2017 Link to this post

    How to draw the needle on top
  2. Petar Marchev
    Admin
    Petar Marchev avatar
    1029 posts

    Posted 20 Feb 2017 Link to this post

    Hello Кrystian,

    You indicated that the Product of this thread is Chart for Xamarin Cross-Platform, but it seems that you are asking about the Gauge so I changed the Product to Gauges for Xamarin Cross-Platform.

    At the moment the gauge lacks ZIndex functionality and the default order of drawing is as follows:
    1. Axis elements are drawn first
    2. Ranges are drawn on top
    3. Indicators are drawn on top

    Note that the indicators are drawn in the order they appear in the Indicators collection.

    From the above explanation one expects to see that the needle should always be drawn on top of the ranges. But because this does not happen in your case, I suspect that the blue-green-red ring is not ranges, it is three bar indicators. Perhaps the bar indicators are added after the needle indicator and this is why it is below the bars. You need to simply add the needle last, after the bars.

    Because you are using the the blue-green-red ring as ranges (not to show a particular value, but give meaningful context of the needle value) I suggest that you don't use bar indicators - use ranges.

    I hope I was able to address your question accordingly. Let us know if you need more information.

    Regards,
    Petar Marchev
    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. Petar Marchev
    Admin
    Petar Marchev avatar
    1029 posts

    Posted 20 Feb 2017 Link to this post

    I just realized that the Xamarin Forms Gauge control does not support minor ticks. Can you specify which component exactly are you using?

    Regards,
    Petar Marchev
    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
  4. krystian
    krystian avatar
    4 posts
    Member since:
    Jan 2017

    Posted 23 Feb 2017 in reply to Petar Marchev Link to this post

    I do not know which component is it? Unfortunately, changing the order of the needle does not help, still underneath. Jescze I question whether you can use several indicators next to each other on a single layout and how to do it
  5. Petar Marchev
    Admin
    Petar Marchev avatar
    1029 posts

    Posted 27 Feb 2017 Link to this post

    Hi,

    We cannot be of much help if we do not know which control you are using. We have different gauges - in WPF, in Android, in iOS, in WinForms and so on. You need to find out what type of project you are developing so that we know which team to refer the ticket to.


    Regards,
    Petar Marchev
    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
  6. krystian
    krystian avatar
    4 posts
    Member since:
    Jan 2017

    Posted 27 Feb 2017 in reply to Petar Marchev Link to this post

    Hello My project is being built in Xamarin android.

    I have one question is whether interactivity gauges will be soon introduced to android. how far it is introduced to ios.

    Regards

  7. Todor
    Admin
    Todor avatar
    798 posts

    Posted 28 Feb 2017 Link to this post

    Hello Krystian,

    I'm glad we are now clear on the product that you are using. Regarding the first question about the needle - the solution Petar suggested for the Xamarin Forms Gauges is applicable for Xamarin.Android Gauges as well - the order in which you adds the indicators to your scale determines the order in which they are drawn. For example, if you generated the gauge from the first screen with a code similar to this:

    scale1.AddIndicator(needle);           
    scale1.AddIndicator(GetIndicator(34, 36, Color.Blue));
    scale1.AddIndicator(GetIndicator(36.05f, 40, Color.Red));      

    Then you simply need to change the order:

    scale1.AddIndicator(GetIndicator(34, 36, Color.Blue));
    scale1.AddIndicator(GetIndicator(36.05f, 40, Color.Red));
    scale1.AddIndicator(needle);

    If you are still having issues with the indicators, please add sample code (or project) that demonstrates how we can reproduce the issue in order to assist you further.

    Regarding the interaction gauges, we already have such a request which you can vote for here. It is not yet planned so I can't give an exact date when to expect it, but if its votes increase, we will be more specific.

    Regards,
    Todor
    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