from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
from PyQt5.QtChart import QChart, QChartView, QBarSet, QPercentBarSeries, QBarCategoryAxis
from PyQt5.QtGui import QPainter
from PyQt5.QtCore import Qt
 
 
 
 
class Window(QMainWindow):
    def __init__(self):
        super().__init__()
 
        self.setWindowTitle("PyQt BarChart")
        self.setGeometry(100,100, 680,500)
        self.show()
        self.create_bar()
 
 
 
 
    def create_bar(self):
        #The QBarSet class represents a set of bars in the bar chart.
         # It groups several bars into a bar set
 
        set0 = QBarSet("Parwiz")
        set1 = QBarSet("Bob")
        set2 = QBarSet("Tom")
        set3 = QBarSet("Logan")
        set4 = QBarSet("Karim")
 
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
 
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
 
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle("Percent Example")
        chart.setAnimationOptions(QChart.SeriesAnimations)
 
        categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
 
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
 
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        #chartView.setRubberBand(QChartView.HorizontalRubberBand) # Включение масштабирования
        #chartView.setRubberBand(QChartView.RectangleRubberBand) # Включение масштабирования
 
        self.setCentralWidget(chartView)
 
 
 
 
 
App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec_())
8121e8c7da8087f5340f8c99d1e00105daff8208
<mask token>


class Window(QMainWindow):
    <mask token>

    def create_bar(self):
        set0 = QBarSet('Parwiz')
        set1 = QBarSet('Bob')
        set2 = QBarSet('Tom')
        set3 = QBarSet('Logan')
        set4 = QBarSet('Karim')
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle('Percent Example')
        chart.setAnimationOptions(QChart.SeriesAnimations)
        categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        self.setCentralWidget(chartView)


<mask token>

<mask token>


class Window(QMainWindow):

    def __init__(self):
        super().__init__()
        self.setWindowTitle('PyQt BarChart')
        self.setGeometry(100, 100, 680, 500)
        self.show()
        self.create_bar()

    def create_bar(self):
        set0 = QBarSet('Parwiz')
        set1 = QBarSet('Bob')
        set2 = QBarSet('Tom')
        set3 = QBarSet('Logan')
        set4 = QBarSet('Karim')
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle('Percent Example')
        chart.setAnimationOptions(QChart.SeriesAnimations)
        categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        self.setCentralWidget(chartView)


<mask token>

<mask token>


class Window(QMainWindow):

    def __init__(self):
        super().__init__()
        self.setWindowTitle('PyQt BarChart')
        self.setGeometry(100, 100, 680, 500)
        self.show()
        self.create_bar()

    def create_bar(self):
        set0 = QBarSet('Parwiz')
        set1 = QBarSet('Bob')
        set2 = QBarSet('Tom')
        set3 = QBarSet('Logan')
        set4 = QBarSet('Karim')
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle('Percent Example')
        chart.setAnimationOptions(QChart.SeriesAnimations)
        categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        self.setCentralWidget(chartView)


<mask token>
sys.exit(App.exec_())

from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
from PyQt5.QtChart import QChart, QChartView, QBarSet, QPercentBarSeries, QBarCategoryAxis
from PyQt5.QtGui import QPainter
from PyQt5.QtCore import Qt


class Window(QMainWindow):

    def __init__(self):
        super().__init__()
        self.setWindowTitle('PyQt BarChart')
        self.setGeometry(100, 100, 680, 500)
        self.show()
        self.create_bar()

    def create_bar(self):
        set0 = QBarSet('Parwiz')
        set1 = QBarSet('Bob')
        set2 = QBarSet('Tom')
        set3 = QBarSet('Logan')
        set4 = QBarSet('Karim')
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle('Percent Example')
        chart.setAnimationOptions(QChart.SeriesAnimations)
        categories = ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun']
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        self.setCentralWidget(chartView)


App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec_())

from PyQt5.QtWidgets import QApplication, QMainWindow
import sys
from PyQt5.QtChart import QChart, QChartView, QBarSet, QPercentBarSeries, QBarCategoryAxis
from PyQt5.QtGui import QPainter
from PyQt5.QtCore import Qt
 
 
 
 
class Window(QMainWindow):
    def __init__(self):
        super().__init__()
 
        self.setWindowTitle("PyQt BarChart")
        self.setGeometry(100,100, 680,500)
        self.show()
        self.create_bar()
 
 
 
 
    def create_bar(self):
        #The QBarSet class represents a set of bars in the bar chart.
         # It groups several bars into a bar set
 
        set0 = QBarSet("Parwiz")
        set1 = QBarSet("Bob")
        set2 = QBarSet("Tom")
        set3 = QBarSet("Logan")
        set4 = QBarSet("Karim")
 
        set0 << 1 << 2 << 3 << 4 << 5 << 6
        set1 << 5 << 0 << 0 << 4 << 0 << 7
        set2 << 3 << 5 << 8 << 13 << 8 << 5
        set3 << 5 << 6 << 7 << 3 << 4 << 5
        set4 << 9 << 7 << 5 << 3 << 1 << 2
 
        series = QPercentBarSeries()
        series.append(set0)
        series.append(set1)
        series.append(set2)
        series.append(set3)
        series.append(set4)
 
        chart = QChart()
        chart.addSeries(series)
        chart.setTitle("Percent Example")
        chart.setAnimationOptions(QChart.SeriesAnimations)
 
        categories = ["Jan", "Feb", "Mar", "Apr", "May", "Jun"]
        axis = QBarCategoryAxis()
        axis.append(categories)
        chart.createDefaultAxes()
        chart.setAxisX(axis, series)
 
        chart.legend().setVisible(True)
        chart.legend().setAlignment(Qt.AlignBottom)
 
        chartView = QChartView(chart)
        chartView.setRenderHint(QPainter.Antialiasing)
        #chartView.setRubberBand(QChartView.HorizontalRubberBand) # Включение масштабирования
        #chartView.setRubberBand(QChartView.RectangleRubberBand) # Включение масштабирования
 
        self.setCentralWidget(chartView)
 
 
 
 
 
App = QApplication(sys.argv)
window = Window()
sys.exit(App.exec_())