Skip to main content
Nzhan.15
Associate III
Jun 20, 2019 3:16 AM UTC
Question

How to draw a sine wave in a specific width and height ?

Hi, I am trying to draw a sine wave, but just confused that how to specify the width and height, particularly for the setRange() functions, the graphic it draws are not I expected, sometime too small, sometime draw nothing. My Demo Screen is 800 * 480 (PC UI), I want to draw a sine wave graphic that the height is 240 and its width is 800.

The attachment is my source code, thanks!!!

This topic has been closed for replies.

6 replies

Martin KJELDSEN
Principal III
Jun 30, 2019 8:57 PM UTC

Hi,

Before i start checking code - Can you show me what you have on screen? I'll try to explain the things you're requesting when i'm back at the office.

Thanks!

/Martin

Nzhan.15
Nzhan.15Author
Associate III
Jul 16, 2019 2:42 AM UTC

Yes, here it is.

0690X000009YmJKQA0.png

lxw
Associate III
Jul 17, 2019 6:17 AM UTC

Graph in the touchgfx-open-repository-master folder can fulfill your requirements

Nzhan.15
Nzhan.15Author
Associate III
Aug 29, 2019 7:36 AM UTC

Thanks!!

Martin KJELDSEN
Principal III
Aug 5, 2019 12:24 PM UTC

Hi, back from vacation here. Did you get anywhere on your own in the meantime? Just by looking it seems your graph Container may not be tall enough so you're essentially cutting off the peaks. Just a quick guess.

/Martin

Nzhan.15
Nzhan.15Author
Associate III
Aug 29, 2019 7:38 AM UTC

Yes, I think my container should be improved again.