10-15-2019, 08:31 PM
It not very well documented. We have a bunch of old examples in xml format in the file:
$TACTIC_INSTALL_DIR/src/tactic/ui/config/reports-conf.xml
They are in an old format using LinkWdg, but you can translate it pretty easily:
For example:
<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="LinkWdg">
<class_name>tactic.ui.chart.CalendarChartWdg</class_name>
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>
The current format does not use "LinkWdg" and is translated as follows:
<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="tactic.ui.chart.CalendarChartWdg">
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>
... which can be used directly in a Custom Layout
or you can just use straight Python code:
widget = CalendarChartWdg(
title="Task Completed Chart",
y_title="# Tasks",
search_type="sthpw/task",
start_date="{$THIS_YEAR}",
elements="{@COUNT()}",
column="actual_end_date".
chart_type="bar"
)
$TACTIC_INSTALL_DIR/src/tactic/ui/config/reports-conf.xml
They are in an old format using LinkWdg, but you can translate it pretty easily:
For example:
<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="LinkWdg">
<class_name>tactic.ui.chart.CalendarChartWdg</class_name>
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>
The current format does not use "LinkWdg" and is translated as follows:
<element name='weekly_tasks_completed' title='Weekly Tasks Completed' image="GRAPH_BAR_04" description='Task count completed each week'>
<display class="tactic.ui.chart.CalendarChartWdg">
<title>Task Completed Chart</title>
<y_title># Tasks</y_title>
<search_type>sthpw/task</search_type>
<start_date>{$THIS_YEAR}</start_date>
<elements>{@COUNT()}</elements>
<column>actual_end_date</column>
<chart_type>bar</chart_type>
</display>
</element>
... which can be used directly in a Custom Layout
or you can just use straight Python code:
widget = CalendarChartWdg(
title="Task Completed Chart",
y_title="# Tasks",
search_type="sthpw/task",
start_date="{$THIS_YEAR}",
elements="{@COUNT()}",
column="actual_end_date".
chart_type="bar"
)