• 大小: 8KB
    文件类型: .py
    金币: 2
    下载: 1 次
    发布日期: 2021-06-05
  • 语言: Python
  • 标签: pyqt5  

资源简介

pyqt、echarts示例源码。..................................................

资源截图

代码片段和文件信息

# -*- coding: utf-8 -*-
# @Time    : 2019/1/28 14:23
# @Author  : llc
# @File    : test_js.py

from PyQt5.QtCore import QUrl Qt
from PyQt5.QtWebEngineWidgets import QWebEngineView
from PyQt5.QtWidgets import QDialog QApplication QHBoxLayout QWidget QGridLayout QLabel QSpinBox \
    QSpacerItem QSizePolicy QComboBox
from random import randint
from pyecharts import Bar Pie Line Overlap
from pyecharts_javascripthon.api import TRANSLATOR

title_TEXT = “我的第一个图表“
title_SUBTEXT = “这里是副标题“
ATTR = [“衬衫“ “羊毛衫“ “雪纺衫“ “裤子“ “高跟鞋“ “袜子“]


class Form(QDialog):
    def __init__(self):
        super(Form self).__init__()

        self.view = None
        self.echarts = False
        self.initUi()
        self.load_url()

    def initUi(self):
        self.hl = QHBoxLayout(self)
        self.widget = QWidget()
        self.gl = QGridLayout(self.widget)
        # ATTR1
        label1 = QLabel(ATTR[0] + ‘:‘)
        self.gl.addWidget(label1 1 - 1 0 1 1)
        self.spinbox1 = QSpinBox()
        self.spinbox1.setSingleStep(100)
        self.spinbox1.setobjectName(‘spinbox‘)
        self.spinbox1.valueChanged.connect(self.set_options)
        self.spinbox1.setMaximum(1000)
        self.spinbox1.setValue(randint(0 1000))
        self.gl.addWidget(self.spinbox1 1 - 1 1 1 1)
        # ATTR2
        label2 = QLabel(ATTR[1] + ‘:‘)
        self.gl.addWidget(label2 2 - 1 0 1 1)
        self.spinbox2 = QSpinBox()
        self.spinbox2.setSingleStep(100)
        self.spinbox2.setobjectName(‘spinbox‘)
        self.spinbox2.valueChanged.connect(self.set_options)
        self.spinbox2.setMaximum(1000)
        self.spinbox2.setValue(randint(0 1000))
        self.gl.addWidget(self.spinbox2 2 - 1 1 1 1)
        # ATTR3
        label3 = QLabel(ATTR[2] + ‘:‘)
        self.gl.addWidget(label3 3 - 1 0 1 1)
        self.spinbox3 = QSpinBox()
        self.spinbox3.setSingleStep(100)
        self.spinbox3.setobjectName(‘spinbox‘)
        self.spinbox3.valueChanged.connect(self.set_options)
        self.spinbox3.setMaximum(1000)
        self.spinbox3.setValue(randint(0 1000))
        self.gl.addWidget(self.spinbox3 3 - 1 1 1 1)
        # ATTR4
        label4 = QLabel(ATTR[3] + ‘:‘)
        self.gl.addWidget(label4 4 - 1 0 1 1)
        self.spinbox4 = QSpinBox()
        self.spinbox4.setSingleStep(100)
        self.spinbox4.setobjectName(‘spinbox‘)
        self.spinbox4.valueChanged.connect(self.set_options)
        self.spinbox4.setMaximum(1000)
        self.spinbox4.setValue(randint(0 1000))
        self.gl.addWidget(self.spinbox4 4 - 1 1 1 1)
        # ATTR5
        label5 = QLabel(ATTR[4] + ‘:‘)
        self.gl.addWidget(label5 5 - 1 0 1 1)
        self.spinbox5 = QSpinBox()
        self.spinbox5.setSingleStep(100)
        self.spinbox5.setobjectName(‘spinbox‘)
        self.spinbox5.valueChanged.connect(self.set_options)
        self.spinbox5.setMaximu

评论

共有 条评论