Skip to content
Open
Show file tree
Hide file tree
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
3 changes: 3 additions & 0 deletions DataPlotly/core/plot_settings.py
Original file line number Diff line number Diff line change
Expand Up @@ -147,6 +147,9 @@ def __init__(self, plot_type: str = 'scatter', properties: dict = None, layout:
'pie_hole': 0,
'fill': False,
'line_combo_threshold': 'Dot Line',
'font_plot_family': 'Arial',
'font_plot_size': 10,
'font_plot_color': '#000000',
# Be consistent with the value of line_combo_threshold
# since the value of 'line_dash_threshold is set from
# the combo value
Expand Down
7 changes: 6 additions & 1 deletion DataPlotly/core/plot_types/pie.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,12 @@ def create_trace(settings):
'colors': settings.data_defined_colors if settings.data_defined_colors else [settings.properties['in_color']]
},
name=settings.properties['custom'][0],
hole=settings.properties.get('pie_hole', 0)
hole=settings.properties.get('pie_hole', 0),
textfont={
'size': settings.properties.get('font_plot_size', 30),
'color': settings.properties.get('font_plot_color', '#000000'),
'family': settings.properties.get('font_plot_family', 'Arial')
}
)]

@staticmethod
Expand Down
13 changes: 11 additions & 2 deletions DataPlotly/gui/plot_settings_widget.py
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,8 @@
QgsExpressionContextGenerator,
QgsPropertyCollection,
QgsLayoutItemRegistry,
QgsPropertyDefinition
QgsPropertyDefinition,
QgsTextFormat
)
from qgis.gui import (
QgsPanelWidget,
Expand Down Expand Up @@ -378,6 +379,9 @@ def __init__(self, mode=MODE_CANVAS, parent=None, override_iface=None, message_b
self.font_ylabel_style.setCurrentFont(QFont('Arial', 10))
self.font_yticks_style.setCurrentFont(QFont('Arial', 10))
self.font_legend_style.setCurrentFont(QFont('Arial', 10))
default_text_format = QgsTextFormat()
default_text_format.setFont(QFont('Arial', 10))
self.font_plot_style.setTextFormat(default_text_format)

# set range of axis min/max spin boxes
self.x_axis_min.setRange(sys.float_info.max * -1, sys.float_info.max)
Expand Down Expand Up @@ -1069,6 +1073,8 @@ def refreshWidgets(self): # pylint: disable=too-many-statements,too-many-branch
self.violinBox: ['violin'],
self.pie_hole_label : ['pie'],
self.pie_hole : ['pie'],
self.font_plot_label: ['pie'],
self.font_plot_style: ['pie'],
self.fill : ['radar'],
self.threshold: ['radar'],
self.threshold_value: ['radar'],
Expand Down Expand Up @@ -1245,7 +1251,10 @@ def get_settings(self) -> PlotSettings: # pylint: disable=R0915
'threshold_value': self.threshold_value.value(),
'y_fields_combo': ', '.join(self.y_fields_combo.checkedItems()),
'connect_gaps': self.scatterline_gaps_check.isChecked(),
'interpolation_shape': self.scatterline_interpolation_combo.currentData()
'interpolation_shape': self.scatterline_interpolation_combo.currentData(),
'font_plot_size': self.font_plot_style.textFormat().size(),
'font_plot_family': self.font_plot_style.textFormat().font().family(),
'font_plot_color': self.font_plot_style.textFormat().color().name()
}

if self.in_color_defined_button.isActive():
Expand Down
Loading
Loading