Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How pyqt5 do I draw the following picture? #143

Open
lyl1836 opened this issue Oct 23, 2021 · 1 comment
Open

How pyqt5 do I draw the following picture? #143

lyl1836 opened this issue Oct 23, 2021 · 1 comment

Comments

@lyl1836
Copy link

lyl1836 commented Oct 23, 2021

Dear teacher
I want to pyqt5 draw the following picture.

p2

Detailed requirements:
1、On the outside is a K-line diagram, and inside is a table or text group.
2、You want the graphics to zoom with the mouse.

I have some experience in K-line drawing, but I don't have enough experience in word processing.
Text drawn with pg.textitem does not scale automatically.

Excuse me: what kind of text drawing scheme should I use?

@lyl1836
Copy link
Author

lyl1836 commented Oct 25, 2021

Dear teacher:
p3

At present, this effect has been achieved and the goal has been preliminarily achieved, but there are still some problems:
The current text position is offset. For example, set the position through textitem.setpos (1,14030). Because the text has a height, the display position is below 14030.

If I want the middle of the text to be displayed at 14030, I need to offset the Y axis of the text.
However, due to market changes, the actual display range of y-axis is not fixed. For example, the maximum and minimum values of some products are 3500-6050, and some products are 12000-18000.

Excuse me?

  1. I want the text display position to be right in the middle of the Y axis. What should I do?

  2. Is there a way to read the maximum and minimum values of the Y axis of pg.graphicslayoutwidget.addplot layer?

  3. How to read: the corresponding height of text under different font sizes of textitem object?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant