diff options
Diffstat (limited to 'examples/charts/chartthemes')
-rw-r--r-- | examples/charts/chartthemes/main.py | 39 |
1 files changed, 24 insertions, 15 deletions
diff --git a/examples/charts/chartthemes/main.py b/examples/charts/chartthemes/main.py index 5f3bfce10..b385d0b5e 100644 --- a/examples/charts/chartthemes/main.py +++ b/examples/charts/chartthemes/main.py @@ -171,7 +171,7 @@ class ThemeWidget(QWidget): for j in range(len(self.data_table[i])): data = self.data_table[i][j] if lower_series: - points = lower_series.pointsVector() + points = lower_series.points() y_value = points[i].y() + data[0].y() upper_series.append(QPointF(j, y_value)) else: @@ -182,10 +182,12 @@ class ThemeWidget(QWidget): lower_series = upper_series chart.createDefaultAxes() - chart.axisX().setRange(0, self.value_count - 1) - chart.axisY().setRange(0, self.value_max) + axis_x = chart.axes(Qt.Horizontal)[0] + axis_x.setRange(0, self.value_count - 1) + axis_y = chart.axes(Qt.Vertical)[0] + axis_y.setRange(0, self.value_max) # Add space to label to add space between labels and axis - chart.axisY().setLabelFormat("%.1f ") + axis_y.setLabelFormat("%.1f ") return chart @@ -203,9 +205,10 @@ class ThemeWidget(QWidget): chart.addSeries(series) chart.createDefaultAxes() - chart.axisY().setRange(0, self.value_max * 2) + axis_y = chart.axes(Qt.Vertical)[0] + axis_y.setRange(0, self.value_max * 2) # Add space to label to add space between labels and axis - chart.axisY().setLabelFormat("%.1f ") + axis_y.setLabelFormat("%.1f ") return chart @@ -222,10 +225,12 @@ class ThemeWidget(QWidget): chart.addSeries(series) chart.createDefaultAxes() - chart.axisX().setRange(0, self.value_max) - chart.axisY().setRange(0, self.value_count) + axis_x = chart.axes(Qt.Horizontal)[0] + axis_x.setRange(0, self.value_max) + axis_y = chart.axes(Qt.Vertical)[0] + axis_y.setRange(0, self.value_count) # Add space to label to add space between labels and axis - chart.axisY().setLabelFormat("%.1f ") + axis_y.setLabelFormat("%.1f ") return chart @@ -259,10 +264,12 @@ class ThemeWidget(QWidget): chart.addSeries(series) chart.createDefaultAxes() - chart.axisX().setRange(0, self.value_max) - chart.axisY().setRange(0, self.value_count) + axis_x = chart.axes(Qt.Horizontal)[0] + axis_x.setRange(0, self.value_max) + axis_y = chart.axes(Qt.Vertical)[0] + axis_y.setRange(0, self.value_count) # Add space to label to add space between labels and axis - chart.axisY().setLabelFormat("%.1f ") + axis_y.setLabelFormat("%.1f ") return chart @@ -278,10 +285,12 @@ class ThemeWidget(QWidget): chart.addSeries(series) chart.createDefaultAxes() - chart.axisX().setRange(0, self.value_max) - chart.axisY().setRange(0, self.value_count) + axis_x = chart.axes(Qt.Horizontal)[0] + axis_x.setRange(0, self.value_max) + axis_y = chart.axes(Qt.Vertical)[0] + axis_y.setRange(0, self.value_count) # Add space to label to add space between labels and axis - chart.axisY().setLabelFormat("%.1f ") + axis_y.setLabelFormat("%.1f ") return chart |