Merhaba
Arkdaşları basit bir BarChart yapmak istiyorum. Fakat datalar değişken olduğu için Sqlite tablosu kullanması gerekiyor. Kodları aşağıdaki gibi hazırladım. Fakat hata veriyor.
Yardıma ihtiyacım var.
def Chart_bar_delivery():
setbar = QBarSet('KNIT') Query = ("SELECT knit_date, sum([knit_XS]+[knit_S]+[knit_M]+[knit_L]+[knit_XL]+[knit_XXL]) as 'TOTAL' FROM knit_table \ WHERE knit_date > DATETIME('now', '-30 day') GROUP BY knit_date") islem.execute(Query) if Query == []: return knit_date_totals = islem.fetchall() setbar.append(int(knit_date_totals[1])) series = QBarSeries() series.append(setbar) chart = QChart() chart.addSeries(series) chart.setTitle('Daily Knitting Chart') chart.setAnimationOptions(QChart.seriesAnimations) Query2 = ("SELECT knit_date, sum([knit_XS]+[knit_S]+[knit_M]+[knit_L]+[knit_XL]+[knit_XXL]) as 'TOTAL' FROM knit_table \ WHERE knit_date > DATETIME('now', '-30 day') GROUP BY knit_date") islem.execute(Query2) if Query2 == []: return knit_date_report = islem.fetchall() axisX = QBarCategoryAxis() axisX.append(knit_date_report[0].values) axisY = QValueAxis() axisY.setRange(0,3000) chart.addAxis(axisX, alignment=BOTTOM) chart.addAxis(axisY, alignment=LEFT) chart.legend().setVisible(TRUE) chart.legend().setAlignment(alignment=BOTTOM) ui.chart_bar_delivery(QChartView)