Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
I
intranet-reporting-dashboard
Project
Project
Details
Activity
Releases
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
project-open
intranet-reporting-dashboard
Commits
169f5262
Commit
169f5262
authored
Jun 17, 2016
by
Frank Bergmann
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
- added scatter diagram to general reporting components
parent
d8ea608e
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
134 additions
and
0 deletions
+134
-0
scatter-diagram.adp
lib/scatter-diagram.adp
+86
-0
scatter-diagram.tcl
lib/scatter-diagram.tcl
+48
-0
No files found.
lib/scatter-diagram.adp
0 → 100644
View file @
169f5262
<if @project_count@ ge 2>
<div id=@diagram_id@></div>
<script type='text/javascript'>
Ext.require(['Ext.chart.*', 'Ext.Window', 'Ext.fx.target.Sprite', 'Ext.layout.container.Fit']);
window.store1 = Ext.create('Ext.data.JsonStore', {
fields: ['x_axis', 'y_axis', 'color', 'diameter', 'caption', 'url'],
data: @data_json;noquote@
});
function createHandler(fieldName) {
return function(sprite, record, attr, index, store) {
return Ext.apply(attr, {
radius: record.get('diameter'),
fill: record.get('color')
});
};
}
Ext.onReady(function () {
chart = new Ext.chart.Chart({
width: @diagram_width@,
height: @diagram_height@,
animate: true,
store: store1,
renderTo: '@diagram_id@',
axes: [{
@axis_y_title_json;noquote@
type: 'Numeric',
position: 'left',
fields: ['y_axis'],
grid: true
}, {
@axis_x_title_json;noquote@
type: 'Numeric',
position: 'bottom',
fields: ['x_axis']
}],
series: [{
type: 'scatter',
axis: 'left',
xField: 'x_axis',
yField: 'y_axis',
highlight: true,
markerConfig: { type: 'circle' },
renderer: createHandler('xxx'),
label: {
display: 'under',
field: 'caption',
'text-anchor': 'left',
color: '#000'
},
listeners: {
itemmousedown: function(obj) {
var url = obj.storeItem.data['url'];
window.open(url, "_blank");
}
},
tips: {
trackMouse: false,
anchor: 'right',
width: 200,
height: 50,
renderer: function(storeItem, item) {
var xTitle = '';
var yTitle = '';
if ("" != '@diagram_x_title;noquote@') { xTitle = '@diagram_x_title;noquote@='; }
if ("" != '@diagram_y_title;noquote@') { yTitle = '@diagram_y_title;noquote@='; }
this.setTitle(
"<a href='"+storeItem.get('url')+"' target='_blank'>" +
storeItem.get('caption') + ":<br>\n" +
xTitle + storeItem.get('x_axis') + ', ' +
yTitle + storeItem.get('y_axis') +
"</a>"
);
}
}
}]
}
)});
</script>
</if>
lib/scatter-diagram.tcl
0 → 100644
View file @
169f5262
# /packages/sencha-reporting-portfolio/lib/scatter-diagram.tcl
#
# Copyright (C
)
2011
]
project-open
[
#
# All rights reserved. Please check
# http://www.project-open.com/license/ for details.
# ----------------------------------------------------------------------
#
# ---------------------------------------------------------------------
# The following variables are expected in the environment
# defined by the calling /tcl/*.tcl libary:
# program_id
# diagram_width
# diagram_height
# sql Defines the columns x_axis, y_axis, color and diameter
# Create a random ID for the diagram
set
diagram_id
"margin_tracker_
[
expr
round
(
rand
()
* 100000000.0
)]
"
set
x_axis 0
set
y_axis 0
set
color
"yellow"
set
diameter 5
set
title
""
set
axis_x_title_json
""
set
axis_y_title_json
""
if
{[
info
exists diagram_x_title
]
&&
""
ne
$diagram
_x_title
}
{
set axis_x_title_json
"title: '
$diagram
_x_title',"
}
if
{[
info
exists diagram_y_title
]
&&
""
ne
$diagram
_y_title
}
{
set axis_y_title_json
"title: '
$diagram
_y_title',"
}
set
data_list
{}
set
project_count 0
set
url
""
db_foreach scatter_sql
$sql
{
if
{
$project
_count > 10
}
{
continue
}
lappend data_list
"{x_axis:
$x
_axis, y_axis:
$y
_axis, color: '
$color
', diameter:
$diameter
, caption: '
$title
', url: '
$url
'}"
incr project_count
}
set
data_json
"
\[\n
"
append
data_json
[
join
$data
_list
",
\n
"
]
append
data_json
"
\n\]\n
"
# ad_return_complaint 1 "<pre>$data_json</pre>"
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment