diff options
author | Agustin Zubiaga <aguz@sugarlabs.org> | 2013-11-18 20:32:14 (GMT) |
---|---|---|
committer | Agustin Zubiaga <aguz@sugarlabs.org> | 2013-11-18 20:32:14 (GMT) |
commit | 2767551bf75593d88be8a46b5e62f55c496ffd43 (patch) | |
tree | 79a1f72a66124f7dbeeb5b9976f1b63d40990c66 /chart.py | |
parent | 6e8a632f38a2301fc4f65bb9d83e4db2103fe60f (diff) |
Font change implemented
Tick (X and Y values) colortoolbutton is not working cause SugarPycha
does not support (change values color) it yet, it always draw it black.
Signed-off-by: Agustin Zubiaga <aguz@sugarlabs.org>
Diffstat (limited to 'chart.py')
-rw-r--r-- | chart.py | 25 |
1 files changed, 24 insertions, 1 deletions
@@ -55,10 +55,16 @@ class Chart(GObject.GObject): self.options = { 'legend': {'hide': True}, - 'titleFontSize': 16, + 'titleColor': '#000000', + 'titleFont': 'Tahoma', + 'titleFontSize': 12, 'axis': { + 'tickColor': '#F3F3F3', + 'tickFont': 'Sans', 'tickFontSize': 12, 'labelFontSize': 14, + 'labelColor': '#666666', + 'labelFont': 'Sans', 'lineColor': '#b3b3b3', 'x': { 'ticks': [dict(v=i, label=l[0]) for i, @@ -70,6 +76,7 @@ class Chart(GObject.GObject): 'label': 'Y', } }, + 'yvals': {'fontColor': '#000000'}, 'stroke': { 'width': 3 }, @@ -85,6 +92,22 @@ class Chart(GObject.GObject): }, } + def set_font_options(self, op): + self.options['titleFont'] = op['titleFont'] + self.options['titleFontSize'] = op['titleFontSize'] + self.options['titleColor'] = op['titleColor'] + self.options['axis']['labelFont'] = op['axis']['labelFont'] + self.options['axis']['labelFontSize'] = op['axis']['labelFontSize'] + self.options['axis']['labelColor'] = op['axis']['labelColor'] + self.options['axis']['tickFont'] = op['axis']['tickFont'] + self.options['axis']['tickFontSize'] = op['axis']['tickFontSize'] + self.options['yvals']['fontColor'] = op['yvals']['fontColor'] + + if self.type == PIE: + self.options['axis']['labelFont'] = op['axis']['tickFont'] + self.options['axis']['labelFontSize'] = op['axis']['tickFontSize'] + self.options['axis']['labelColor'] = op['axis']['tickColor'] + def set_color_scheme(self, color='blue'): '''Set the chart color scheme''' self.options['colorScheme']['args'] = {'initialColor': color} |