Pyside6能够滚动的折线图

import sys
import random
from PySide6.QtWidgets import QApplication, QGraphicsView, QGraphicsScene, QGraphicsItem
from PySide6.QtCore import Qt, QPointF, QRectF
from PySide6.QtGui import QPainter, QPen, QColor, QFont
class ScrollableLineGraph(QGraphicsItem):
def __init__(self, data):
super().__init__()
self.data = data
self.current_start = 0
self.bounding_rect = QRectF(0, 0, 600, 450)
def boundingRect(self):
return self.bounding_rect
def paint(self, painter, option, widget):
painter.setRenderHint(QPainter.Antialiasing)
axis_pen = QPen(QColor(128, 128, 128))
line_pen = QPen(QColor(0, 0

最低0.47元/天 解锁文章
816

被折叠的 条评论
为什么被折叠?



