Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[ENH] Boxplot: Allow hiding labels #2654

Merged
merged 1 commit into from
Oct 13, 2017
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 11 additions & 5 deletions Orange/widgets/visualize/owboxplot.py
Original file line number Diff line number Diff line change
Expand Up @@ -139,6 +139,7 @@ class Outputs:
stattest = Setting(0)
sig_threshold = Setting(0.05)
stretched = Setting(True)
show_labels = Setting(True)
auto_commit = Setting(True)

_sorting_criteria_attrs = {
Expand Down Expand Up @@ -226,10 +227,15 @@ def __init__(self):
callback=self.layout_changed)

# The vertical size policy is needed to let only the list views expand
self.stretching_box = gui.checkBox(
self.controlArea, self, 'stretched', "Stretch bars", box='Display',
callback=self.display_changed,
sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Maximum)).box
self.stretching_box = box = gui.vBox(
self.controlArea, box="Display",
sizePolicy=(QSizePolicy.Minimum, QSizePolicy.Maximum))
gui.checkBox(
box, self, 'stretched', "Stretch bars",
callback=self.display_changed)
gui.checkBox(
box, self, 'show_labels', "Show box labels",
callback=self.display_changed)

gui.auto_commit(self.controlArea, self, "auto_commit",
"Send Selection", "Send Automatically")
Expand Down Expand Up @@ -544,7 +550,7 @@ def display_changed_disc(self):
label.setPos(right + 10, y - b.height() / 2)
self.box_scene.addItem(label)

if self.attribute is not self.group_var:
if self.show_labels and self.attribute is not self.group_var:
for text_item, bar_part in zip(box[1::2], box[::2]):
label = QGraphicsSimpleTextItem(
text_item.toPlainText())
Expand Down