This commit is contained in:
恍兮惚兮 2024-04-11 21:12:39 +08:00
parent 73f72865d8
commit 22a35c9b86

View File

@ -59,7 +59,15 @@ class chartwidget(QWidget):
xmargin = xmargin + self.scalelinelen xmargin = xmargin + self.scalelinelen
width = self.width() - xmargin - self.fmetrics.width(x_labels[-1]) // 2 width = (
self.width()
- xmargin
- max(
self.fmetrics.width(x_labels[-1]) // 2,
self.fmetrics.width(self.ytext(self.data[-1][1])) // 2,
)
)
height = self.height() - 2 * ymargin height = self.height() - 2 * ymargin
# 纵坐标 # 纵坐标