Jump to content
Wiki Home
EPrints Home
Bazaar
Files
Main menu
Main menu
move to sidebar
hide
Navigation
Front Page
EPrints 3 Manual
EPrints Training Course
EPrints Glossary
Installing EPrints
How-to Configure EPrints
EPrints 3.2+ API
EPrints 3 Reference
EPrints Plugins
Wiki
All categories
Recent changes
Main Page
Help
EPrints Documentation
Search
Search
Appearance
Log in
Request account
Personal tools
Log in
Request account
Pages for logged out editors
learn more
Contributions
Talk
Editing
IRStats2
(section)
Page
Discussion
British English
Read
Edit
View history
Tools
Tools
move to sidebar
hide
Actions
Read
Edit
View history
General
What links here
Related changes
Special pages
Page information
Appearance
move to sidebar
hide
Warning:
You are not logged in. Your IP address will be publicly visible if you make any edits. If you
log in
or
create an account
, your edits will be attributed to your username, along with other benefits.
Anti-spam check. Do
not
fill this in!
==Embedding data== This is similar to retrieving data from scripts (cf. section above) but with a few extra options: *"view": the name of the Stats::View plug-in which will draw the requested stuff (a Table? a Graph? etc.) *"container_id": the DOM element "id", where the drawn stuff will be inserted on the page (if the Ajax callback is successful) Then there exists a number of options proper to each View plug-in. See the provided examples below. ===Graphs=== The typical example is to embed the global downloads graph. This is usually the first displayed item on the IRStats2 main report page (/cgi/stats/report). <pre> <!-- This will basically insert the downloads graph into the "mygraph" div element. Note that it's using the supplied "irstats2_googlegraph" CSS class. Context options: - irs2report: What type of report/data do you want to display (e.g. "main", "deposits", "requests") - range: What date range show this report cover (e.g. "_ALL_" is across all dates, "1y" is the last year "1m" is the last month, etc.) - datatype: What type of data is being displayed (e.g. "downloads", "views", "deposits", "countries") - datafilter: What attribute on which to filter the data (e.g. "archive") - set_name: A set on which to filter (e.g. "authors", "type", "divisions", "subjects", "eprintid") - set_value: A value in the set on which to filterm (e.g for an author the hash of their name such as "c6edf1ce30d927a9a005e4b272ead4b4" for a division or subject, their subject ID, for eprint type, its type ID) Graph options: - graph_type: either "column" or "area" - show_average: either 1 or 0 - displays the average graph' - date_resolution: either "year", "month" or "day" - groups data by year, month or day (be careful: selecting day may generate LOTS of data points) --> <div id="mygraph" class="irstats2_googlegraph"/> <script type="text/javascript"> document.observe("dom:loaded",function(){ new EPJS_Stats_GoogleGraph( { 'context': {'irs2report': 'main', 'range': '_ALL_', 'datatype': 'downloads'}, 'options': { 'graph_type': 'column', 'container_id': 'mygraph', 'view': 'Google::Graph', 'show_average': '1', 'date_resolution': 'month' } }); }); </script> </pre> ===Tables=== The example below displays the top 10 downloaded eprints in the repository. <pre> <!-- This will insert the top table into the "mytable" div element. Note that it's using the supplied "irstats2_table" CSS class. Context options: - irs2report: What type of report/data do you want to display (e.g. "most_popular_eprints", "most_popular_authors") - range: What date range show this report cover (e.g. "_ALL_" is across all dates, "1y" is the last year "1m" is the last month, etc.) - datatype: What type of data is being displayed (e.g. "downloads", "views") - set_name: A set on which to filter (e.g. "authors", "type", "divisions", "subjects", "eprintid") - set_value: A value in the set on which to filterm (e.g for an author the hash of their name such as "c6edf1ce30d927a9a005e4b272ead4b4" for a division or subject, their subject ID, for eprint type, its type ID) Table options: - top: the top "thing" to display - similar to the "grouping" parameter when using scripts - limit: the max number of items to retrieve - show_count: 1 or 0 - display the counts or not - show_order: 1 or 0 - display the ordering (1,2,3 ...) or not - show_more: 1 or 0 - shows the "show more" options or not (to retrieve more results) - human_display: 1 or 0 - separate 1000 with a comma (as done in English): 10000 becomes 10,000 --> <div id="mytable" class="irstats_table"/> <script type="text/javascript"> document.observe( "dom:loaded", function() { new EPJS_Stats_Table( { 'context': { 'irs2report': 'most_popular_eprints', 'range': '_ALL_', 'datatype': 'downloads'}, 'options': { 'container_id': 'mytable', 'top': 'eprint', 'view': 'Table', 'limit': '5' } } ); }); </script> </pre> ===Misc=== Graphs and Tables are the most common displays, but there are a few other ones to explore. The javascript classes are in 90_irstats2.js and the associated PERL Class in Stats/View/ *GoogleSpark: similar to GoogleGraph but shows a sparkline instead (which is essentially a tiny graph). *GoogleGeoChart: country map *GooglePieChart: a pie chart *Counter: a simple counter (for instance to show the download count for your repository). The View prefixed by "Google" means that they are rendered by the Google Chart Javascript library. Important note: no data is sent to Google! The data is, instead, drawn by the browser client using SVG.
Summary:
Please note that all contributions to EPrints Documentation may be edited, altered, or removed by other contributors. If you do not want your writing to be edited mercilessly, then do not submit it here.
You are also promising us that you wrote this yourself, or copied it from a public domain or similar free resource (see
EPrints Documentation:Copyrights
for details).
Do not submit copyrighted work without permission!
Cancel
Editing help
(opens in new window)