diff --git a/DataPlotly/core/plot_settings.py b/DataPlotly/core/plot_settings.py
index b78e643d..9e7ec930 100644
--- a/DataPlotly/core/plot_settings.py
+++ b/DataPlotly/core/plot_settings.py
@@ -51,6 +51,9 @@ class PlotSettings: # pylint: disable=too-many-instance-attributes
PROPERTY_FONT_YTICKS_SIZE = 27
PROPERTY_FONT_YTICKS_FAMILY = 28
PROPERTY_FONT_YTICKS_COLOR = 29
+ PROPERTY_FONT_LEGEND_SIZE = 30
+ PROPERTY_FONT_LEGEND_FAMILY = 31
+ PROPERTY_FONT_LEGEND_COLOR = 32
DYNAMIC_PROPERTIES = {
PROPERTY_FILTER: QgsPropertyDefinition('filter', 'Feature filter', QgsPropertyDefinition.Boolean),
@@ -77,6 +80,9 @@ class PlotSettings: # pylint: disable=too-many-instance-attributes
PROPERTY_FONT_YTICKS_SIZE: QgsPropertyDefinition('font_yticks_size', 'Font yticks size', QgsPropertyDefinition.String),
PROPERTY_FONT_YTICKS_FAMILY: QgsPropertyDefinition('font_yticks_family', 'Font yticks family', QgsPropertyDefinition.String),
PROPERTY_FONT_YTICKS_COLOR: QgsPropertyDefinition('font_yticks_color', 'Font yticks color', QgsPropertyDefinition.ColorWithAlpha),
+ PROPERTY_FONT_LEGEND_SIZE: QgsPropertyDefinition('font_legend_size', 'Font yticks size', QgsPropertyDefinition.String),
+ PROPERTY_FONT_LEGEND_FAMILY: QgsPropertyDefinition('font_legend_family', 'Font yticks family', QgsPropertyDefinition.String),
+ PROPERTY_FONT_LEGEND_COLOR: QgsPropertyDefinition('font_legend_color', 'Font yticks color', QgsPropertyDefinition.ColorWithAlpha),
PROPERTY_X_TITLE: QgsPropertyDefinition('x_title', 'X title', QgsPropertyDefinition.String),
PROPERTY_Y_TITLE: QgsPropertyDefinition('y_title', 'Y title', QgsPropertyDefinition.String),
PROPERTY_Z_TITLE: QgsPropertyDefinition('z_title', 'Z title', QgsPropertyDefinition.String),
@@ -169,6 +175,9 @@ def __init__(self, plot_type: str = 'scatter', properties: dict = None, layout:
'font_yticks_size': 10,
'font_yticks_family': "Arial",
'font_yticks_color': "#000000",
+ 'font_legend_size': 10,
+ 'font_legend_family': "Arial",
+ 'font_legend_color': "#000000",
'xaxis': None,
'bar_mode': None,
'x_type': None,
diff --git a/DataPlotly/core/plot_types/plot_type.py b/DataPlotly/core/plot_types/plot_type.py
index 8a21bd6e..5fcc7fee 100644
--- a/DataPlotly/core/plot_types/plot_type.py
+++ b/DataPlotly/core/plot_types/plot_type.py
@@ -106,7 +106,14 @@ def create_layout(settings):
layout = graph_objs.Layout(
showlegend=settings.layout['legend'],
- legend={'orientation': settings.layout['legend_orientation']},
+ legend={'orientation': settings.layout['legend_orientation'],
+ 'font': {
+ 'size': settings.layout.get('font_legend_size', 10),
+ 'color': settings.layout.get('font_legend_color', "#000"),
+ 'family': settings.layout.get('font_legend_family', "Arial"),
+ }
+ },
+
title=title,
xaxis={
'title': {
diff --git a/DataPlotly/core/plot_types/polar.py b/DataPlotly/core/plot_types/polar.py
index 963e1ec9..794e80e4 100644
--- a/DataPlotly/core/plot_types/polar.py
+++ b/DataPlotly/core/plot_types/polar.py
@@ -59,5 +59,20 @@ def create_layout(settings):
layout = super(PolarChartFactory, PolarChartFactory).create_layout(settings)
layout['polar'] = settings.layout['polar']
-
+ layout['polar'].update({
+ 'radialaxis': {
+ 'tickfont':{
+ "size": settings.layout.get('font_xticks_size',30),
+ "color": settings.layout.get('font_xticks_color',"#00000"),
+ "family": settings.layout.get('font_xticks_family', "Arial"),
+ }
+ },
+ 'angularaxis':{
+ 'tickfont':{
+ "size": settings.layout.get('font_yticks_size',30),
+ "color": settings.layout.get('font_yticks_color',"#00000"),
+ "family": settings.layout.get('font_yticks_family', "Arial")
+ }
+ }
+ })
return layout
diff --git a/DataPlotly/gui/plot_settings_widget.py b/DataPlotly/gui/plot_settings_widget.py
index be4b5e78..81155161 100644
--- a/DataPlotly/gui/plot_settings_widget.py
+++ b/DataPlotly/gui/plot_settings_widget.py
@@ -323,6 +323,7 @@ def __init__(self, mode=MODE_CANVAS, parent=None, override_iface=None, message_b
self.font_xticks_color.setColor(QColor('#000000'))
self.font_ylabel_color.setColor(QColor('#000000'))
self.font_yticks_color.setColor(QColor('#000000'))
+ self.font_legend_color.setColor(QColor('#000000'))
# default fonts
self.font_title_style.setCurrentFont(QFont('Arial', 10))
@@ -330,6 +331,7 @@ def __init__(self, mode=MODE_CANVAS, parent=None, override_iface=None, message_b
self.font_xticks_style.setCurrentFont(QFont('Arial', 10))
self.font_ylabel_style.setCurrentFont(QFont('Arial', 10))
self.font_yticks_style.setCurrentFont(QFont('Arial', 10))
+ self.font_legend_style.setCurrentFont(QFont('Arial', 10))
# set range of axis min/max spin boxes
self.x_axis_min.setRange(sys.float_info.max * -1, sys.float_info.max)
@@ -929,20 +931,23 @@ def refreshWidgets(self): # pylint: disable=too-many-statements,too-many-branch
self.plot_title_line: ['all'],
self.plot_title_defined_button: ['all'],
self.font_title_label: ['all'],
- self.font_xlabel_label: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
- self.font_xticks_label: ['all'],
- self.font_ylabel_label: ['all'],
- self.font_yticks_label: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
+ self.font_xlabel_label: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_xticks_label: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar','radar', 'violin'],
+ self.font_ylabel_label: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_yticks_label: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar','radar', 'violin'],
+ self.font_legend_label: ['all'],
self.font_title_style: ['all'],
- self.font_xlabel_style: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
- self.font_xticks_style: ['all'],
- self.font_ylabel_style: ['all'],
- self.font_yticks_style: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
+ self.font_xlabel_style: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_xticks_style: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar', 'radar', 'violin'],
+ self.font_ylabel_style: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_yticks_style: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar','radar', 'violin'],
+ self.font_legend_style: ['all'],
self.font_title_color: ['all'],
- self.font_xlabel_color: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
- self.font_xticks_color: ['all'],
- self.font_ylabel_color: ['all'],
- self.font_yticks_color: ['scatter', 'bar', 'box', 'pie', '2dhistogram','histogram', 'polar','ternary', 'contour', 'violin'],
+ self.font_xlabel_color: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_xticks_color: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar','radar', 'violin'],
+ self.font_legend_color: ['all'],
+ self.font_ylabel_color: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'violin'],
+ self.font_yticks_color: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'polar','radar', 'violin'],
self.x_axis_label: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'ternary', 'violin'],
self.x_axis_title: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'ternary', 'violin'],
self.x_axis_title_defined_button: ['scatter', 'bar', 'box', 'histogram', '2dhistogram', 'ternary', 'violin'],
@@ -1197,6 +1202,11 @@ def get_settings(self) -> PlotSettings: # pylint: disable=R0915
self.font_yticks_style.currentFont().pointSize()),
'font_yticks_family': self.font_yticks_style.currentFont().family(),
'font_yticks_color': self.font_yticks_color.color().name(),
+ 'font_legend_size': max(
+ self.font_legend_style.currentFont().pixelSize(),
+ self.font_legend_style.currentFont().pointSize()),
+ 'font_legend_family': self.font_legend_style.currentFont().family(),
+ 'font_legend_color': self.font_legend_color.color().name(),
'x_title': self.x_axis_title.text(),
'y_title': self.y_axis_title.text(),
'z_title': self.z_axis_title.text(),
@@ -1315,6 +1325,11 @@ def set_settings(self, settings: PlotSettings): # pylint: disable=too-many-stat
settings.layout.get('font_yticks_size', 10)))
self.font_yticks_color.setColor(
QColor(settings.layout.get('font_yticks_color', "#000000")))
+ self.font_legend_style.setCurrentFont(
+ QFont(settings.layout.get('font_legend_style', "Arial"),
+ settings.layout.get('font_legend_size', 10)))
+ self.font_legend_color.setColor(
+ QColor(settings.layout.get('font_legend_color', "#000000")))
self.font_ylabel_style.setCurrentFont(
QFont(settings.layout.get('font_ylabel_family', "Arial"),
settings.layout.get('font_ylabel_size', 10)))
diff --git a/DataPlotly/ui/dataplotly_dockwidget_base.ui b/DataPlotly/ui/dataplotly_dockwidget_base.ui
index 7b763325..585101ee 100644
--- a/DataPlotly/ui/dataplotly_dockwidget_base.ui
+++ b/DataPlotly/ui/dataplotly_dockwidget_base.ui
@@ -1319,6 +1319,13 @@ QListWidget::item::selected {
+ -
+
+
+ Legend font
+
+
+
-
@@ -1350,6 +1357,13 @@ QListWidget::item::selected {
+ -
+
+
+ QgsFontButton::ModeQFont
+
+
+
-
@@ -1367,6 +1381,9 @@ QListWidget::item::selected {
-
+ -
+
+
-