blob: f74614e55916f86ec0d607fff8f5423c29861567 (
plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
|
# Copyright (C) 2022 The Qt Company Ltd.
# SPDX-License-Identifier: LicenseRef-Qt-Commercial OR BSD-3-Clause
from __future__ import annotations
"""PySide6 port of the Dynamic Spline example from Qt v5.x"""
import sys
from PySide6.QtCharts import QChart, QChartView
from PySide6.QtGui import QPainter
from PySide6.QtWidgets import QApplication, QMainWindow
from chart import Chart
if __name__ == "__main__":
a = QApplication(sys.argv)
window = QMainWindow()
chart = Chart()
chart.setTitle("Dynamic spline chart")
chart.legend().hide()
chart.setAnimationOptions(QChart.AnimationOption.AllAnimations)
chart_view = QChartView(chart)
chart_view.setRenderHint(QPainter.RenderHint.Antialiasing)
window.setCentralWidget(chart_view)
window.resize(400, 300)
window.show()
sys.exit(a.exec())
|