cancel
Showing results for 
Search instead for 
Did you mean: 

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

Nzhan.15
Associate II

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!!!

6 REPLIES 6
Martin KJELDSEN
Chief III

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
Associate II

Yes, here it is.

0690X000009YmJKQA0.png

lxw
Senior

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

Martin KJELDSEN
Chief III

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

Thanks!!

Yes, I think my container should be improved again.