Skip to main content
Nzhan.15
Associate III
June 20, 2019
Question

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

  • June 20, 2019
  • 4 replies
  • 2637 views

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.

4 replies

Martin KJELDSEN
Principal III
June 30, 2019

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
July 16, 2019

Yes, here it is.

0690X000009YmJKQA0.png

lxw
Associate III
July 17, 2019

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

Nzhan.15
Nzhan.15Author
Associate III
August 29, 2019

Thanks!!

Martin KJELDSEN
Principal III
August 5, 2019

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
August 29, 2019

Yes, I think my container should be improved again.