• Administrator
  •  
    Support Ukraine
    If you experience any problems with the forum (it is not visible, there is no way to post messages, or some functionality does not work), please let us know. If you have problems with registration or you did not receive confirmation letter, let us know and we will activate your account manually.
    If you get an "The submitted form was invalid. Try submitting again" error, delete cookies, then try again.
     

heart rate graph WF for GTR4

Topics for the request of watch faces development.

Moderators: asoo, Watchmens

Forum rules
When adding a new topic, use the template: Topic title [device name]
For example: Requesting creation of watch face [GTR 3 Pro]
All communication in this branch should only be in English.
Post Reply
User avatar
Wahwah
Posts: 278
Joined: 27 Mar 2023, 19:09
Location: denver
Has thanked: 99 times
Been thanked: 3 times
Contact:

heart rate graph WF for GTR4

Post by Wahwah »

Hi everyone i’m fairly new to the amazfit community and i have been enjoying all the work and comments everyone making. i have a request i noticed there is not too many watchfaces that has heartrate graph for GTR4 like the one built in the watch i was wondering if someone can make one especially for the heartrate graph plus basic data like time, steps maybe weather temperature. i have been looking there is very nice one made by asoo for gtr3 but it has some reseting problems maybe because i’m using it on my gtr4. any watchface that helps me will be appreciate it. thanks everyone
User avatar
asoo
Posts: 2116
Joined: 03 Jan 2019, 01:48
Location: ͼͽ Thailand ͼͽ
Has thanked: 408 times
Been thanked: 2034 times

Post by asoo »

Wahwah wrote: 18 Jul 2023, 19:06
Spoiler
Hi everyone i’m fairly new to the amazfit community and i have been enjoying all the work and comments everyone making. i have a request i noticed there is not too many watchfaces that has heartrate graph for GTR4 like the one built in the watch i was wondering if someone can make one especially for the heartrate graph plus basic data like time, steps maybe weather temperature. i have been looking there is very nice one made by asoo for gtr3 but it has some reseting problems maybe because i’m using it on my gtr4. any watchface that helps me will be appreciate it. thanks everyone
It has a problem with GTR3 as well. I think it's FW issue because I tried it. official watch face Also had the same problem with the watch face I created (I use the same commands as the official watch face). I tried troubleshooting for a few days and couldn't fix it. The symptom on the GTR3 is that when used for a few days, the Graph will stop working, need to select another watch face Then came back to select the same watch face, the Graph will be work again, So I didn't continue it.
As for GTR4, I'm not sure what the problem is.

This is the code used to display the graph.

Code: Select all

let normal_g_heart = ''
normal_g_heart=hmUI.createWidget(hmUI.widget.GRADKIENT_POLYLINE,{
x: 50,
y: 100,
w: 350,
h: 100,
line_color:0xFF6600,
line_width:2,
type:hmUI.data_type.HEART,
show_level:hmUI.show_level.ONLY_NORMAL
});
This is the code for used to display the last check, min, max, pulse.

Code: Select all

            let heart_num = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
                                        x: 198,
                                        y: 410,
                                 type: hmUI.data_type.HEART,
                                font_array:["Act_font_0.png","Act_font_1.png","Act_font_2.png","Act_font_3.png","Act_font_4.png","Act_font_5.png","Act_font_6.png","Act_font_7.png","Act_font_8.png","Act_font_9.png"],
                                h_space: 2,
                                align_h: hmUI.align.CENTER_H,
                                padding: false,
                                isCharacter: true,
                                invalid_image: "Act_font_0.png",
                                isCharacter: true,
                                unit_sc:"bpm.png",
                                unit_tc: "bpm.png",
                                unit_en: "bpm.png",
});


///////////////////////  show value  max , min /////////////////////////

                                    let heartArr = hmSensor.createSensor(hmSensor.id.HEART).today;
                                    let min_heart = Math.min(...heartArr)
                                    let max_heart = Math.max(...heartArr)


                         let maxText = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
                                        x: 300,
                                        y: 100,
                                text: max_heart,
                                type: hmUI.data_type.HEART,
                                font_array:["Act_font_0.png","Act_font_1.png","Act_font_2.png","Act_font_3.png","Act_font_4.png","Act_font_5.png","Act_font_6.png","Act_font_7.png","Act_font_8.png","Act_font_9.png"],
                                h_space: 2,
                                align_h: hmUI.align.RIGHT,
                                padding: false,
                                isCharacter: true,
                            });


                            let minText = hmUI.createWidget(hmUI.widget.TEXT_IMG, {
                                        x: 300,
                                        y: 170,
                                text: min_heart,
                                type: hmUI.data_type.HEART,
                                font_array:["Act_font_0.png","Act_font_1.png","Act_font_2.png","Act_font_3.png","Act_font_4.png","Act_font_5.png","Act_font_6.png","Act_font_7.png","Act_font_8.png","Act_font_9.png"],
                                h_space: 2,
                                align_h: hmUI.align.RIGHT,
                                padding: false,
                                isCharacter: true,
  });



////////////////////  Update  min max /////////////////////////

let intervalId;


function updateDataHeart() {

                                    let heart = hmSensor.createSensor(hmSensor.id.HEART);
                                    let heartArr = heart.today
                                    let min_heart = Math.min(...heartArr)
                                    let max_heart = Math.max(...heartArr)


normal_heart_rate_text_text_max_img.setProperty(hmUI.prop.MORE, {
        x: 330,
        y: 100,
        text: max_heart,
        type: hmUI.data_type.HEART,
        font_array: ["Act_font_0.png", "Act_font_1.png", "Act_font_2.png", "Act_font_3.png", "Act_font_4.png", "Act_font_5.png", "Act_font_6.png", "Act_font_7.png", "Act_font_8.png", "Act_font_9.png"],
        h_space: 2,
        align_h: hmUI.align.RIGHT,
        padding: false,
        isCharacter: true,
show_level: hmUI.show_level.ONLY_NORMAL,
    });

normal_heart_rate_text_text_min_img.setProperty(hmUI.prop.MORE, {
        x: 330,
        y: 170,
        text: min_heart,
        type: hmUI.data_type.HEART,
        font_array: ["Act_font_0.png", "Act_font_1.png", "Act_font_2.png", "Act_font_3.png", "Act_font_4.png", "Act_font_5.png", "Act_font_6.png", "Act_font_7.png", "Act_font_8.png", "Act_font_9.png"],
        h_space: 2,
        align_h: hmUI.align.RIGHT,
        padding: false,
        isCharacter: true,
show_level: hmUI.show_level.ONLY_NORMAL,
    });
}

intervalId = setInterval(updateDataHeart, 1000);
     //dynamic modify end
Anyone interested can test it.
ͼͽ To request please use the interrelated forum in action ͼͽ
Please do not PM to me for requests ported watchface.
User avatar
Wahwah
Posts: 278
Joined: 27 Mar 2023, 19:09
Location: denver
Has thanked: 99 times
Been thanked: 3 times
Contact:

Post by Wahwah »

yeah man i really enjoyed this watchface and i was annoyed that it never reset after mid night 🙁 but i still appreciate you trying fixing it. i’m sure someone will help us figure this out 🙂
Post Reply

Return to “Watchfaces creation (order table)”

Who is online

Users browsing this forum: No registered users and 0 guests