Commit 9636dec0 authored by Julien Muchembled's avatar Julien Muchembled

Add properties on OOoChart fields to customize X/Y Axis

git-svn-id: https://svn.erp5.org/repos/public/erp5/trunk@30059 20353a03-c40f-0410-a6d1-a30d3c3de9de
parent 3775c847
......@@ -168,16 +168,17 @@
</tal:block>\n
<style:style style:name="chart_x_axis"\n
style:family="chart"\n
style:data-style-name="N0">\n
<style:chart-properties chart:display-label="true"\n
chart:tick-marks-major-inner="true"\n
chart:tick-marks-major-outer="true"\n
chart:logarithmic="false"\n
chart:text-overlap="true"\n
text:line-break="true"\n
chart:label-arrangement="side-by-side"\n
chart:visible="true"\n
style:direction="ltr"/>\n
style:data-style-name="N0"\n
tal:define="property_dict python:{\n
\'chart:display-label\': \'true\',\n
\'chart:tick-marks-major-inner\': \'true\',\n
\'chart:tick-marks-major-outer\': \'true\'};\n
x_axis_property_dict x_axis_property_dict | request/x_axis_property_dict;\n
dummy python: property_dict.update(x_axis_property_dict)">\n
<tal:block replace="structure python: \'&lt;style:chart-properties %s /&gt;\'\n
% \' \'.join(\'%s=%r\' % (k, v)\n
for k, v in property_dict.items()\n
if v is not None)" />\n
<style:graphic-properties draw:stroke="solid"\n
svg:stroke-width="0cm"\n
svg:stroke-color="#000000"/>\n
......@@ -185,19 +186,17 @@
</style:style>\n
<style:style style:name="chart_y_axis"\n
style:family="chart"\n
style:data-style-name="N0">\n
<style:chart-properties chart:display-label="true"\n
chart:tick-marks-major-inner="true"\n
chart:tick-marks-major-outer="true"\n
chart:logarithmic="false"\n
chart:origin="0"\n
chart:gap-width="100"\n
chart:overlap="0"\n
chart:text-overlap="false"\n
text:line-break="false"\n
chart:label-arrangement="side-by-side"\n
chart:visible="true"\n
style:direction="ltr"/>\n
style:data-style-name="N0"\n
tal:define="property_dict python:{\n
\'chart:display-label\': \'true\',\n
\'chart:tick-marks-major-inner\': \'true\',\n
\'chart:tick-marks-major-outer\': \'true\'};\n
y_axis_property_dict y_axis_property_dict | request/y_axis_property_dict;\n
dummy python: property_dict.update(y_axis_property_dict)">\n
<tal:block replace="structure python: \'&lt;style:chart-properties %s /&gt;\'\n
% \' \'.join(\'%s=%r\' % (k, v)\n
for k, v in property_dict.items()\n
if v is not None)" />\n
<style:graphic-properties draw:stroke="solid"\n
svg:stroke-width="0cm"\n
svg:stroke-color="#000000"/>\n
......
1349
\ No newline at end of file
1350
\ No newline at end of file
......@@ -55,12 +55,8 @@ class OOoChartWidget(Widget.Widget):
property_names = list(Widget.Widget.property_names)
default = fields.StringField(
'default',
title='Default',
description=("A default value (not used)."),
default="",
required=0)
# Default has no meaning in OOoChart.
property_names.remove('default')
listbox_form_id = fields.StringField(
'listbox_form_id',
......@@ -173,6 +169,30 @@ class OOoChartWidget(Widget.Widget):
required=0)
property_names.append('chart_title_or_no')
# Axis
x_axis_property_list = fields.ListTextAreaField('x_axis_property_list',
title="X-Axis Properties",
description="Examples of recognized properties:"
" 'chart:visible',"
" 'chart:display-label',"
" 'chart:label-arrangement',"
" 'chart:tick-marks-major-inner',"
" 'chart:reverse-direction',"
" 'chart:logarithmic',"
" 'chart:text-overlap',"
" 'chart:origin',"
" 'text:line-break',"
" 'style:rotation-angle'...",
default=(),
required=0)
property_names.append('x_axis_property_list')
y_axis_property_list = fields.ListTextAreaField('y_axis_property_list',
title="Y-Axis Properties",
default=(),
required=0)
property_names.append('y_axis_property_list')
#grid or not
grid_graph = fields.CheckBoxField('grid_graph',
title='Chart Grid ',
......@@ -248,7 +268,6 @@ class OOoChartWidget(Widget.Widget):
default=0,
required=0)
property_names.append('sector_pie_offset')
#interpolation="none", cubic-spline, b-spline
......@@ -358,6 +377,8 @@ class OOoChartWidget(Widget.Widget):
chart_position = field.get_value('chart_position'),
chart_legend = stringBoolean(field.get_value('chart_legend')),
chart_title_or_no = stringBoolean(field.get_value('chart_title_or_no')),
x_axis_property_dict = dict(field.get_value('x_axis_property_list')),
y_axis_property_dict = dict(field.get_value('y_axis_property_list')),
grid_graph = stringBoolean(field.get_value('grid_graph')),
grid_size=field.get_value('grid_size'),
chart_three_dimensional = stringBoolean(field.get_value('chart_three_dimensional')),
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment