aboutsummaryrefslogtreecommitdiffstats
path: root/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
diff options
context:
space:
mode:
Diffstat (limited to 'examples/charts/pointselectionandmarkers/pointselectionandmarkers.py')
-rw-r--r--examples/charts/pointselectionandmarkers/pointselectionandmarkers.py27
1 files changed, 14 insertions, 13 deletions
diff --git a/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py b/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
index 4f9540d42..df7b61687 100644
--- a/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
+++ b/examples/charts/pointselectionandmarkers/pointselectionandmarkers.py
@@ -7,7 +7,8 @@ import sys
from PySide6.QtCore import Slot, QPointF, Qt
from PySide6.QtCharts import QChart, QChartView, QSplineSeries
from PySide6.QtGui import QPainter, QImage
-from PySide6.QtWidgets import QApplication, QMainWindow, QWidget, QGridLayout, QComboBox, QCheckBox, QLabel, QHBoxLayout
+from PySide6.QtWidgets import (QApplication, QMainWindow, QWidget, QGridLayout,
+ QComboBox, QCheckBox, QLabel, QHBoxLayout)
import utilities as Utilities
@@ -20,12 +21,12 @@ if __name__ == "__main__":
marker_size = 20.
series = QSplineSeries()
series.append([QPointF(0, 0),
- QPointF(0.5, 2.27),
- QPointF(1.5, 2.2),
- QPointF(3.3, 1.7),
- QPointF(4.23, 3.1),
- QPointF(5.3, 2.3),
- QPointF(6.47, 4.1)])
+ QPointF(0.5, 2.27),
+ QPointF(1.5, 2.2),
+ QPointF(3.3, 1.7),
+ QPointF(4.23, 3.1),
+ QPointF(5.3, 2.3),
+ QPointF(6.47, 4.1)])
series.setMarkerSize(marker_size)
series.setLightMarker(Utilities.default_light_marker(marker_size))
series.setSelectedLightMarker(Utilities.default_selected_light_marker(marker_size))
@@ -66,16 +67,16 @@ if __name__ == "__main__":
char_point_combobox.addItems(["Red rectangle", "Green triangle", "Orange circle"])
char_point_combobox.currentIndexChanged.connect(set_light_marker)
-
@Slot(int)
def set_selected_light_marker(index):
- series.setSelectedLightMarker(Utilities.get_selected_point_representation(Utilities.selected_point_type(index), marker_size))
+ series.setSelectedLightMarker(
+ Utilities.get_selected_point_representation(
+ Utilities.selected_point_type(index), marker_size))
char_point_selected = QLabel("Char point selected: ")
char_point_selected_combobox.addItems(["Blue triangle", "Yellow rectangle", "Lavender circle"])
char_point_selected_combobox.currentIndexChanged.connect(set_selected_light_marker)
-
@Slot(int)
def set_line_color(index):
series.setColor(Utilities.make_line_color(Utilities.line_color(index)))
@@ -84,11 +85,12 @@ if __name__ == "__main__":
line_color_combobox.addItems(["Blue", "Black", "Mint"])
line_color_combobox.currentIndexChanged.connect(set_line_color)
-
@Slot(int)
def display_unselected_points(checkbox_state):
if checkbox_state:
- series.setLightMarker(Utilities.get_point_representation(Utilities.point_type(char_point_combobox.currentIndex()), marker_size))
+ series.setLightMarker(
+ Utilities.get_point_representation(
+ Utilities.point_type(char_point_combobox.currentIndex()), marker_size))
else:
series.setLightMarker(QImage())
@@ -96,7 +98,6 @@ if __name__ == "__main__":
show_unselected_points_checkbox.setChecked(True)
show_unselected_points_checkbox.stateChanged.connect(display_unselected_points)
-
control_label = QLabel("Marker and Selection Controls")
control_label.setAlignment(Qt.AlignHCenter)
control_label_font = control_label.font()