Everybody likes a pretty graph ;) This patch adds the lightweight Charts.js javascript chart library and implements a couple of example charts on some guided reports.
Created attachment 33368 [details] [review] Charts: Added Charts.js javascript charting library
Created attachment 33369 [details] [review] Added Charts to issues report
Created attachment 33370 [details] [review] Added color to charts
Created attachment 33371 [details] [review] Added line/bar switch
Created attachment 33372 [details] [review] Added graphs to cataloging report
Please add a test plan to make this easier to test! :)
Lol.. it's a bit of a proof of concept at the minute so I hadn't gotten around to a test plan.. Sorry ;) Test Plan: Pre patches, there won't be any graphs anywhere ;) Post patches, Run through 'Statistics Wizards -> Circulation', you should now get a pretty graph as part of the result. Run through 'Statistics Wizards -> Catalog', you shold now get a pretty graph as part of the result. It's a proof of concept for now really.
This could be a good one for the catalyst academy to extend upon :)
Shoudl this be needs sign-off?
Hey, nice graphs :) There are some easy to fix tabs, but don't know what to do with this FAIL koha-tmpl/intranet-tmpl/prog/en/modules/reports/catalogue_stats.tt FAIL forbidden patterns forbidden pattern: console.log (line 301) OK tt_valid OK valid_template FAIL koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt FAIL forbidden patterns forbidden pattern: console.log (line 323) OK tt_valid OK valid_template
This was more a code example than a submission to be honest ;) However, the console log lines could be easily removed to clean up the qa warns.. they're only browser logging to show what's going on so someone might take the example code and apply it to more guided reports. Wan't me to tidy it up a bit?
(In reply to Martin Renvoize from comment #11) > This was more a code example than a submission to be honest ;) > > However, the console log lines could be easily removed to clean up the qa > warns.. they're only browser logging to show what's going on so someone > might take the example code and apply it to more guided reports. > > Wan't me to tidy it up a bit? No problem :) I'll remove tabs and logs.
Created attachment 39777 [details] [review] [SIGNED-OFF] Bug 13219: Charts: Added Charts.js javascript charting library http://bugs.koha-community.org/show_bug.cgi?id=13219 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39778 [details] [review] [SIGNED-OFF] Bug 13219: Added Charts to issues report http://bugs.koha-community.org/show_bug.cgi?id=13219 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39779 [details] [review] [SIGNED-OFF] Bug 13219: Added color to charts http://bugs.koha-community.org/show_bug.cgi?id=13219 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39780 [details] [review] [SIGNED-OFF] Bug 13219: Added line/bar switch http://bugs.koha-community.org/show_bug.cgi?id=13219 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39781 [details] [review] [SIGNED-OFF] Bug 13219: Added graphs to cataloging report http://bugs.koha-community.org/show_bug.cgi?id=13219 Signed-off-by: Bernardo Gonzalez Kriegel <bgkriegel@gmail.com>
Created attachment 39782 [details] [review] Bug 13219: (followup) remove tabs and console messages To make koha-qa happy Tested, nice graphics. Nice feature to play with :)
QA comments: 1/ New JS lib is not added to the about page 2/ The version 1.0.2 of Chart is released (after first submission), not need to include a beta version :) 3/ If there is no result, there is no graph. But the canvas is created => 1000x400px is blank on top of the page. Moreover the button ("Click to change to...") is displayed. 4/ There is no way not to hardcode the canvas size? 1000 could be too wide on small screens. 5/ Maybe it could be better to display the graph under the table (?) 6/ Commented code in js (//circChart.update();) 7/ IMO the colors should not be defined in the pl code but in tt. Moreover the get_colors subroutine is defined twice (c/p is bad ;)) Marked as Failed QA.
Wow.. nice list there Jonathan. Thanks for pointing all those out, I'd love to see this prototype taken forward if you've got the time to make those fixes Bernardo.. at the minute I'm rather snowed under myself. Great to see interest in it though :)
Apply? [(y)es, (n)o, (i)nteractive] y Applying: Bug 13219: Charts: Added Charts.js javascript charting library Applying: Bug 13219: Added Charts to issues report Applying: Bug 13219: Added color to charts fatal: sha1 information is lacking or useless (koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt). Repository lacks necessary blobs to fall back on 3-way merge. Cannot fall back to three-way merge. Patch failed at 0001 Bug 13219: Added color to charts The copy of the patch that failed is found in: /home/vagrant/kohaclone/.git/rebase-apply/patch When you have resolved this problem run "git bz apply --continue". If you would prefer to skip this patch, instead run "git bz apply --skip". To restore the original branch and stop patching run "git bz apply --abort". Patch left in /tmp/SIGNED-OFF-Bug-13219-Added-color-to-charts-_jxQr5.patch I would like to work on this, but patch does not apply
Looks like the patches here are getting quite old. Could we say this is a duplicate of Bug 17282?
*** This bug has been marked as a duplicate of bug 17282 ***
I think there might still be some need for this as the other tool is for saved sql reports, but we should decide on one JavaScript library to include.