Post your questions and help other users.
Moderator: Martin
-
Biały
- Posts: 2
- Joined: 03 Jan 2014 09:01
Post
by Biały » 03 Jan 2014 09:10
Hello
i'm new on this board and - it's important - I'm not good in english language

I would to know, how to I can make a diagram(like this:
http://scr.hu/0pl4/n0h5q) in custom widget?
Thank's for answers:)
BTW. I hope, that you understand me

-
Martin
- Posts: 4468
- Joined: 09 Nov 2012 14:23
Post
by Martin » 03 Jan 2014 15:03
Hi,
The round progress indicators are built using two ellipses/circles. The ellipse used to show the progress uses the Arc setting to only show a part of the ellipse.
1) press Add Element in the action bar and create a new Ellipse element
2) change position/size of the newly created ellipse
2) uncheck Fill, check Outline and change the color of the outline to gray
3) press Menu->Copy Element (the copy operation uses the exact same settings and exact same location of the new element so you might only notice the change in the element name which will be something like 'Ellipse_1 copy_1')
4) set the outline color to blue and outline width to ~10
5) expand section Ellipse, check Arc, uncheck Center, set Start angle to 270 and Sweep angle to a value between 0 and 360 to change the progress
You can change the property Sweep angle using a script action in a flow. Something like this:
-action Script: setWidgetElementProperty("WidgetX", "Ellipse_1 copy_1", "sweepangle", 200)
or using a variable, for example:
-trigger Battery Level: higher than 0%
-action Script: setWidgetElementProperty("WidgetX", "Ellipse_1 copy_1", "sweepangle", battery_percentage*360/100)
I highly recommend to use a proper name for the widget and for the ellipse elements before you start making scripts that modify the elements.
Also use button Function in action script to select the function setWidgetElementProperty. Automagic will show a dialog to select the widget and element names which makes it much easier to select the correct names.
Regards,
Martin
-
Biały
- Posts: 2
- Joined: 03 Jan 2014 09:01
Post
by Biały » 03 Jan 2014 17:01
It's works, thank's.
