Your Moodle version

Blocks: Statistics (Graph Stats)

Maintained by Picture of Éric Bugnet Éric Bugnet, Picture of Vadim Dvorovenko Vadim Dvorovenko
Little graph with visitors statistics

This block allow you to view a little graph in your Moodle 2.x with visitors statistics.
This is the evolution of the Graph_Stats block.

In first page, it shows visitors (unique and multi), with details of user and course count.

In course, it shows visitor to the course only.

People with the coursereport/log:view capacity can see a simple page wich show who was connected today, and a link for the course reports of the day. 


You can define :

  • size
  • colors
  • style
  • number of days to shown

With help of some of you, some translation are already (partially) complete : thanks !


Screenshot #0


Picture of Éric Bugnet
Éric Bugnet (Lead maintainer): Dev
Picture of Vadim Dvorovenko
Vadim Dvorovenko: Maintainer
Picture of Jean FRUITET
Jean FRUITET: Helper for Moodle 2 transition
Please login to view contributors details and/or to contact them

Comments RSS

Show comments
  • Picture of 平 钟
    Tue, Jun 18, 2013, 11:45 PM
    //zh_cn <?PHP
    //Moodle 2.0
    $string['pluginname'] = 'Statistics';

    // Added for V2
    $string['style'] = '类型';
    $string['style_help'] = '图片类型';
    $string['moredetails'] = '更多细节';
    $string['area'] = '区域';
    $string['classic'] = '风格 : 条形 和 线形';
    $string['engine'] = '引擎';
    $string['engine_help'] = '渲染引擎';
    $string['visitors'] = '访问者';
    $string['uniquevisitors'] = '单一访问者';

    // English langage
    $string['blockname'] = '本站统计';
    $string['connectedtoday'] = '今天上线 : ';
    $string['coursesnb'] = '总课程数 : ';
    $string['graphtitle'] = '最后 {$a} 天上线';
    $string['membersnb'] = '总用户数 : ';
    $string['seemsnotconfigured'] = '该版块没有配置,请告知您的管理员.';

    // Settings
    $string['axis_colour'] = '坐标轴';
    $string['color1'] = '图形 1';
    $string['color2'] = '图形 2';
    $string['axis_colour_help'] = '坐标轴颜色';
    $string['color1_help'] = '第一个图形的颜色';
    $string['color2_help'] = '第二个图形的颜色';
    $string['daysnb_help'] = '在图形中显示的天数';
    $string['graphheight_help'] = '图形高度';
    $string['graphwidth_help'] = '图形宽度';
    $string['inner_background_help'] = '图形背景颜色';
    $string['inner_border_help'] = '边框颜色';
    $string['multi_help'] = '在首页显示多个连接';
    $string['outer_background_help'] = '背景颜色';
    $string['daysnb'] = '天数';
    $string['graphheight'] = '高度';
    $string['graphwidth'] = '宽度';
    $string['inner_background'] = '图形背景';
    $string['inner_border'] = '边框';
    $string['multi'] = '多个连接';
    $string['outer_background'] = '背景';

    // Colors
    $string['aqua'] = '浅绿色';
    $string['black'] = '黑色';
    $string['blue'] = '蓝色';
    $string['fuchsia'] = '紫红色';
    $string['gray'] = '灰色';
    $string['green'] = '绿色';
    $string['lime'] = '淡黄绿色';
    $string['maroon'] = '褐紫红色';
    $string['navy'] = '深蓝';
    $string['olive'] = '橄榄色';
    $string['orange'] = '橙色';
    $string['purple'] = '紫色';
    $string['red'] = '红色';
    $string['white'] = '白色';
    $string['yellow'] = '黄色';
  • Frankie's the name, Moodle's my game!
    Fri, Aug 2, 2013, 1:54 AM
    How do I change the colors of the graph?
  • Frankie's the name, Moodle's my game!
    Fri, Aug 2, 2013, 2:17 AM
    Oh okay. I got it. But how if I want a colour that's not on the menu? I want the inner background of the graph to be of #DF6382 colour. Where do I change the setting to achieve this?
  • Picture of Jean FRUITET
    Sat, Aug 3, 2013, 3:59 PM
    I think the easier is to edit
    and change the value of
    $string['white'] = 'White'; (used as backgroud color)
    to what you like...
    Better, set a local block_graph_stats.php to keep your modification after an upgrade.
  • Picture of Ali Rajabpour Sanati
    Thu, Nov 14, 2013, 12:16 AM
    will be any version for moodle 2.5? the current version is not working
  • Picture of Wesley Ellis
    Wed, Apr 16, 2014, 11:00 PM
    This should work in Moodle 2.6+
  • Picture of Jean FRUITET
    Thu, Apr 17, 2014, 3:28 AM
    Thanx Wesley, this version should do work with Moodle 2.5 too.
  • Picture of Jean FRUITET
    Thu, Apr 17, 2014, 5:27 AM
    A few corrections needed in detail.php

    Line 44 : change $context = get_context_instance(CONTEXT_COURSE, $course_id); to $context = context_course::instance($course_id);
    Line 53, change if (has_capability('coursereport/log:view', $context)) { to if (has_capability('report/log:view', $context)) {
    Line 55, change echo '<a href="'.$CFG->wwwroot.'/course/report/log/index.php?chooselog=1 ... to echo '<a href="'.$CFG->wwwroot.'/report/log/index.php?chooselog=1 ...
    By the way, the block graph_stats for Moodle 2.6 will work fine for Moodle 2.5
  • Picture of Wesley Ellis
    Thu, Apr 17, 2014, 10:32 PM
    I have updated the git repos with your changes Jean, made things easier. I have also started running the block through the code checker but this will take a while. I am happy to maintain this block is somebody would like to add my repo to the source list.
  • Picture of Wesley Ellis
    Thu, Apr 24, 2014, 11:49 PM
    Updated my repo with a new beta release. Main improvements:

    - Removed Moodle graphing
    - Graph is now 100% width (Responsive)
    - Changed settings for colours to colour pickers (Can now choose hex codes for graph colours)
    - Optimized code + tidy up
    - Corrected code using Moodle Code Checker

    Avaiable here:
  • rui
    Thu, Jul 24, 2014, 12:58 AM
    Apparently, Wesley's version isn't yet working with moodle 2.7
    I upgraded to 2.7 and graph_stats stopped seeing the user entries. It still reports the previous entries, but none since the core upgrade. Does anyone have a solution?
  • Picture of Mario Wehr
    Thu, Jul 24, 2014, 4:52 AM

    I updated Wesleys repo with 2.7 compatible log calls.
    This version should work with pre and post 2.7 Moodles.

    Feel free to test it.

  • Picture of Vadim Dvorovenko
    Fri, Jul 25, 2014, 4:31 PM
    Mario Wehr, we were doing the same things ..
    Please take a look at
    It works only with moodle 2.7+ (for older versions please use version by Wesley Ellis), but have some code improvements.
  • Picture of Jean FRUITET
    Mon, Jul 28, 2014, 4:00 PM
    Hi Vadim, tanx a lot for these improvements.
    Can you please add all languages strings to your version ?

  • Picture of Vadim Dvorovenko
    Thu, Jul 31, 2014, 2:41 AM
    Yes, Jean, l have added them. But, i'm not shure it's right way.
    These langpacks are old, they have unused strings and does not have some new strings, added by Wesley Ellis (uniquevisitors). I've deleted unused strings, but i cannot add missing.
    Currently translation for all modules in Moodle plugins repository are maintained via AMOS ( Translation, made via AMOS (and downloaded with langpack) takes precedence over version in plugin's directory. So it's not needed any more to add translations to plugin. But for AMOS it is needed, that new version is uploaded to moodle Plugins directory. (
    Only the maintainer (Éric Bugnet) can do so. If it's not possible to contact him to update version here, or ask him to transfer plugin to other maintainer, we should create alternate plugin record (e.g. graph_stats2)
1 2
Please login to post comments