Skip navigation.
Home
The QNX Community Portal

View topic - Display the scale on a trend graph ?

Page 1 of 1

Display the scale on a trend graph ?

PostPosted: Tue Oct 30, 2012 5:00 pm
by _KB_
Hi,

I would like to know if there is a flag to set or maybe a function to call in order to display the scale on a trend graph grid?

If not what are my options? (labels, raw widget, ... ?)

Thanks a lot!

Re: Display the scale on a trend graph ?

PostPosted: Thu Nov 01, 2012 1:42 am
by maschoen
I'm not sure if you meant a vertical or horizontal scale.

In either case I think you answered your own question.
If you put a label or raw widget on top of the trend widget that have transparent backgrounds,
the trend will show through. Those are the obvious ones, but you can put any type of widget
you want.

If you update the trend frequently, you may get a lot of flashing.
To mitigate that you can put everything into an PtOSContainer widget.

Re: Display the scale on a trend graph ?

PostPosted: Fri Nov 02, 2012 10:12 pm
by _KB_
Thank you for your answer.

I meant both vertical and horizontal scales. My final goal is to display a spectrum of 1024 samples with zoom capability.
Besides, I would like to add vertical and horizontal cursors on the trend too and to display the coordinates of each sample when I put the cursor on the spectrum.

I guess the trend widget does not fit my goal (I blow my mind to try to zoom on the X-scale :shock: ) and that I will have to code my own widget in order to achieve that :|

Or maybe with a raw widget and few functions such as PgDrawTrend, PgDrawPixelArray, PgDrawPolygon and so on ...

What do you think about it ? I'm a little confused here :roll:

Any tip, link or snippet of code would be appreciated!

Re: Display the scale on a trend graph ?

PostPosted: Wed Nov 07, 2012 7:55 am
by _KB_
My final goal is to display a spectrum of 1024 samples with zoom capability.
Besides, I would like to add vertical and horizontal cursors on the trend too and to display the coordinates of each
sample when I put the cursor on the spectrum.

I guess the trend widget does not fit my goal (I blow my mind to try to zoom on the X-scale! ) and that I will have to
code my own widget in order to achieve that :|

Or maybe with a raw widget and few functions such as PgDrawTrend], PgDrawPixelArray, PgDrawPolygon and so on ...

What do you think about it ? I'm a little confused here

Any tip, link or snippet of code would be appreciated!

Re: Display the scale on a trend graph ?

PostPosted: Fri Nov 16, 2012 12:55 pm
by maschoen
At the lowest level, all widgets are just painting graphically, sometimes with the assistance of the font manager for text. If the available widgets don't provide the visual functionality you need, then yes, using a raw widget is a good way to go. The alternative is to write your own widget.