Commit 44b82197 authored by Frank Bergmann's avatar Frank Bergmann

- Fixed Milestone Tracker

parent 457c79ab
<if "" ne @data_list@>
<if "1" eq @show_diagram_p@>
<div id=@diagram_id@></div>
<script type='text/javascript'>
// Special variant of a line series for milestone tracker...
// ... that actually skips "undefined" values in the store.
Ext.define('Ext.chart.series.MilestoneLine', {
extend: 'Ext.chart.series.Line',
type: 'milestoneline',
alias: 'series.milestoneline',
drawSeries: function() {
var me = this,
chart = me.chart,
store = chart.getChartStore();
// Loop throught the store and convert empty strings into "undefined" values.
// Undefined values are skipped by the underlying series.Line diagram.
store.each(function(record) {
for (var key in record.data) {
var value = record.data[key];
if ("string" == typeof value && "" == value) { record.data[key] = undefined; }
}
});
// Call the basic drawSeries(), now skipping empty values
this.callParent(arguments);
}
});
Ext.require(['Ext.chart.*', 'Ext.Window', 'Ext.fx.target.Sprite', 'Ext.layout.container.Fit']);
Ext.onReady(function () {
window.store = Ext.create('Ext.data.JsonStore', {
var store = Ext.create('Ext.data.JsonStore', {
fields: @fields_json;noquote@,
data: @data_json;noquote@
});
Ext.onReady(function () {
chart = new Ext.chart.Chart({
width: 600,
height: 300,
......@@ -19,27 +44,47 @@ Ext.onReady(function () {
renderTo: '@diagram_id@',
legend: { position: 'right' },
axes: [{
type: 'Time',
position: 'left',
fields: [@fields_joined;noquote@],
dateFormat: 'M Y',
constrain: false,
step: [Ext.Date.MONTH, 2],
fromDate: @y_axis_min_date_js;noquote@,
toDate: @y_axis_max_date_js;noquote@,
type: 'Time',
position: 'left',
fields: [@fields_joined;noquote@],
dateFormat: 'M Y',
constrain: false,
step: [Ext.Date.MONTH, @yrange_step_months@],
fromDate: @yrange_start_date_js;noquote@,
toDate: @yrange_end_date_js;noquote@,
}, {
type: 'Time',
position: 'bottom',
fields: 'date',
dateFormat: 'M Y',
constrain: false,
step: [Ext.Date.MONTH, 2],
fromDate: @start_date_js;noquote@,
toDate: @end_date_js;noquote@
type: 'Time',
position: 'bottom',
fields: 'date',
dateFormat: 'M Y',
constrain: false,
step: [Ext.Date.MONTH, @tracker_step_months@],
fromDate: @tracker_start_date_js;noquote@,
toDate: @tracker_end_date_js;noquote@,
label: {rotate: {degrees: 315}}
}],
series: [@series_json@]
series: [@series_json;noquote@]
}
)});
</script>
<p>audit_count=
<%= [db_string audits "
select count(*)
from im_audits a,
im_projects p,
im_projects main_p
where main_p.project_id = :main_project_id and
p.tree_sortkey between main_p.tree_sortkey and tree_right(main_p.tree_sortkey) and
p.project_id = a.audit_object_id
"] %></p>
@debug_html;noquote@
-->
</if>
This diff is collapsed.
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