猫史档案馆


图表分析软件

用户:lemonyCEklemonyCEk查看:0 回复:0 评论:0 创建时间:2022-12-31T21:09:43


import sys import os
from PySide2.QtWidgets import * from ui_charts import Ui_Charts from plots import plots from PySide2.QtCore import QUrl from PySide2.QtWebEngineWidgets import QWebEngineView

class MyCharts(QMainWindow,Ui_Charts): def__init__(self): super().__init__() self.setupUi(self) self.init_set() self.show() self.pbtn_data.clicked.connect(self.select_file) self.cb_chart_list.currentIndexChanged.connect(self.plot)
def init_set(self): self.browser = QWebEngineView() self.vl_chart.addWidget(self.browser) def select_file(self): self.data_file,_ = QFileDialog.getOpenFileName( caption="选择数据文件",filter="(*.json)") self.lb_info.setText(self.data_file) def plot(self): index_text = self.cb_chart_list.currentText() if self.data_file: plots(self.data_file,index_text) self.browser.load(QUrl.fromLocalFile(os.path.realpath("render.html")))

if __name__ == "__main__": app = QApplication(sys.argv) window = MyCharts() sys.exit(app.exec_())


回复

上一页1 页 / 共 0下一页