Display the scale on a trend graph ?

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!

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.

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 :open_mouth: ) and that I will have to code my own widget in order to achieve that :neutral_face:

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 :unamused:

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

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 :neutral_face:

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!

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.