Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mahara
mahara
Commits
a7116259
Commit
a7116259
authored
Jul 31, 2015
by
Robert Lyon
Committed by
Gerrit Code Review
Jul 31, 2015
Browse files
Merge "Bug 1472889: Adjustments to some of the stats graphs"
parents
f554abdd
346c57e4
Changes
5
Hide whitespace changes
Inline
Side-by-side
htdocs/json/graphdata.php
View file @
a7116259
...
...
@@ -47,6 +47,21 @@ if (!defined('CRON')) {
if
(
!
empty
(
$data
[
'jsondata'
]))
{
$jsondata
=
json_decode
(
$data
[
'jsondata'
]);
if
(
!
empty
(
$colours
))
{
// Update the stored graph jsondata with colours passed in via .tpl file
// This allows us to display the graph in the theme's colours rather than
// default colours the graph jsondata was saved in.
$colours
=
get_graph_colours
(
$data
,
$colours
);
$x
=
0
;
foreach
(
$jsondata
[
0
]
as
$key
=>
$option
)
{
foreach
(
$option
as
$optkey
=>
$optval
)
{
if
(
preg_match
(
'/^rgba\(/'
,
$optval
))
{
$jsondata
[
0
][
$key
]
->
$optkey
=
preg_replace
(
'/\((.*\,)/'
,
'('
.
$colours
[
$x
]
.
','
,
$optval
);
}
}
$x
=
empty
(
$colours
[
$x
+
1
])
?
0
:
$x
+
1
;
}
}
$data
[
'datastr'
]
=
json_encode
(
$jsondata
[
0
]);
$data
[
'configstr'
]
=
json_encode
(
$data
[
'configs'
]);
json_reply
(
false
,
array
(
'data'
=>
$data
));
...
...
htdocs/lib/registration.php
View file @
a7116259
...
...
@@ -956,7 +956,7 @@ function user_institution_graph($type = null) {
}
arsort
(
$dataarray
);
// Truncate to avoid trying to fit too many results onto graph
$dataarray
=
array_slice
(
$dataarray
,
0
,
2
5
,
true
);
$dataarray
=
array_slice
(
$dataarray
,
0
,
1
2
,
true
);
$data
[
'graph'
]
=
(
$type
)
?
$type
:
'bar'
;
$data
[
'graph_function_name'
]
=
'user_institution_graph'
;
...
...
htdocs/theme/raw/templates/admin/stats.tpl
View file @
a7116259
...
...
@@ -4,7 +4,7 @@
<script
type=
"application/javascript"
>
{
literal
}
jQuery
(
function
()
{
fetch_graph_data
(
{
'id'
:
'sitestatsgraph'
,
'type'
:
'
bar
'
,
'graph'
:
'graph_site_data_weekly'
}
);
fetch_graph_data
(
{
'id'
:
'sitestatsgraph'
,
'type'
:
'
line
'
,
'graph'
:
'graph_site_data_weekly'
}
);
});
{/
literal
}
</script>
...
...
htdocs/theme/raw/templates/admin/users/stats.tpl
View file @
a7116259
...
...
@@ -4,7 +4,7 @@
<script
type=
"application/javascript"
>
{
literal
}
jQuery
(
function
()
{
fetch_graph_data
(
{
'id'
:
'sitestatsgraph'
,
'type'
:
'
bar
'
,
'graph'
:
'graph_institution_data_weekly'
,
fetch_graph_data
(
{
'id'
:
'sitestatsgraph'
,
'type'
:
'
line
'
,
'graph'
:
'graph_institution_data_weekly'
,
'extradata'
:
{
'institution'
:
'{/literal}{$institutiondata.institution}{literal}'
}
}
);
});
...
...
htdocs/theme/raw/templates/admin/userstatssummary.tpl
View file @
a7116259
...
...
@@ -11,7 +11,15 @@
<script
type=
"application/javascript"
>
{
literal
}
jQuery
(
function
()
{
fetch_graph_data
(
{
'id'
:
'sitestatsusersgraph'
,
'type'
:
'bar'
,
'graph'
:
'user_institution_graph'
}
);
fetch_graph_data
(
{
'id'
:
'sitestatsusersgraph'
,
'type'
:
'bar'
,
'graph'
:
'user_institution_graph'
,
'extradata'
:
{
'configs'
:
{
'multiTooltipTemplate'
:
"<%if (datasetLabel){%><%=datasetLabel%>: <%}%><%= value %>"
}
}
});
});
{/
literal
}
</script>
...
...
Write
Preview
Supports
Markdown
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