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

Different Gauges Different Positions

2 Answers 43 Views
Gauges
This is a migrated thread and some comments may be shown as answers.
This question is locked. New answers and comments are not allowed.
Roel
Top achievements
Rank 1
Roel asked on 07 Jan 2018, 10:54 PM

Hi,

I am new to the use of gauges and I have a question about how to put different gauges in different positions. I amusing StackLayout to place my items but  how to do it with gauges. And how can I still change the bar Indicator in my ts file?

 

Already so much thanks for helping,

Roel Voordendag

2 Answers, 1 is accepted

Sort by
0
Roel
Top achievements
Rank 1
answered on 07 Jan 2018, 10:57 PM

This is how I want it.

 

0
Nikolay Tsonev
Telerik team
answered on 08 Jan 2018, 11:57 AM
Hi,
First of all, thank you for your interest in UI for NativeScript.
About your first question, I would suggest using the GridLayout, which allows you to specify the position of the child elements while using the row and col properties. For example:
<navigation:ExamplePage xmlns:navigation="navigation/example-page" loaded="onPageLoaded" navigatedTo="onNavigatedTo" xmlns:gauge="nativescript-pro-ui/gauges" xmlns="http://www.nativescript.org/tns.xsd">
    <!-- >> gauges-indicators-add-bars-xml -->
    <GridLayout rows="200" columns="* *">
        <gauge:RadRadialGauge col="0" id="gaugeView" margin="10">
        <gauge:RadRadialGauge.scales>
 
........
        </gauge:RadRadialGauge.scales>
    </gauge:RadRadialGauge>
    <StackLayout  col="1">
        <Label text="Test test" textWrap="true" />
        <Label text="Test Gauge and GridLayout" textWrap="true" />
        <Button text="Change indicator color" tap="onTap" />
         
         
    </StackLayout>
    </GridLayout>
     
    <!-- << gauges-indicators-add-bars-xml -->
</navigation:ExamplePage>


More about the Layout system in NativeScript could be found here
If I am understanding your second question correctly, you are looking for a way to change the color of the indicator via code behind. At this time this changing the color is possible only via XML or HTML code. Regarding that, we have already logged this bug here. For further info, you could keep track on the issue.

Hope this information helps.

Regards,
nikolay.tsonev
Progress Telerik
Did you know that you can open private support tickets which are reviewed and answered within 24h by the same team who built the components? This is available in our UI for NativeScript Pro + Support offering.
Tags
Gauges
Asked by
Roel
Top achievements
Rank 1
Answers by
Roel
Top achievements
Rank 1
Nikolay Tsonev
Telerik team
Share this question
or