Bugzilla – Attachment 39780 Details for
Bug 13219
Add graphs to guided reports
Home
|
New
|
Browse
|
Search
|
[?]
|
Reports
|
Help
|
New Account
|
Log In
[x]
|
Forgot Password
Login:
[x]
[patch]
[SIGNED-OFF] Bug 13219: Added line/bar switch
SIGNED-OFF-Bug-13219-Added-linebar-switch.patch (text/plain), 2.61 KB, created by
Bernardo Gonzalez Kriegel
on 2015-06-02 17:05:22 UTC
(
hide
)
Description:
[SIGNED-OFF] Bug 13219: Added line/bar switch
Filename:
MIME Type:
Creator:
Bernardo Gonzalez Kriegel
Created:
2015-06-02 17:05:22 UTC
Size:
2.61 KB
patch
obsolete
>From e84c1327c71b125ec70fa0a1028f3a71008b5d18 Mon Sep 17 00:00:00 2001 >From: Martin Renvoize <martin.renvoize@ptfs-europe.com> >Date: Mon, 8 Sep 2014 09:00:42 +0000 >Subject: [PATCH] [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> >--- > .../prog/en/modules/reports/issues_stats.tt | 30 ++++++++++++++++++-- > 1 file changed, 27 insertions(+), 3 deletions(-) > >diff --git a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >index 72a27af..c5428f6 100644 >--- a/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >+++ b/koha-tmpl/intranet-tmpl/prog/en/modules/reports/issues_stats.tt >@@ -23,6 +23,7 @@ > [% FOREACH mainloo IN mainloop %] > <h1>Circulation statistics</h1> > <canvas id="circChart" width="1000" height="400"></canvas> >+ <div id="toolbar" class="btn-toolbar"><div class="btn-group"><a id="updateChart" class="btn" href="#">Click to change to <span id="chartType">Line</span> Chart</a></div></div> > [% IF ( mainloo.loopfilter ) %] > <p>Filtered on:</p> > <ul> >@@ -299,7 +300,8 @@ > [% IF ( do_it ) %] > <script type="text/javascript"> > var ctx = $("#circChart").get(0).getContext("2d"); >- var circChart = new Chart(ctx).Bar({ >+ >+ var chartData = { > labels: [[% FOREACH loopco IN mainloo.loopcol %]"[% loopco.coltitle_display |html %]", [% END %]], > datasets: [ > [% FOREACH loopro IN mainloo.looprow %]{ >@@ -312,9 +314,31 @@ > pointHighlightStroke: "[% loopro.highlight %]", > data: [[% FOREACH loopcel IN loopro.loopcell %]"[% loopcel.value %]", [% END %]] > }, [% END %]] >- }, {}); >+ }; >+ >+ var chartType = "Bar"; >+ var circChart = new Chart(ctx).Bar( chartData, {}); >+ >+ $("#updateChart").click(function() { >+ console.log("Updating Chart: "); >+ >+ // Replace the chart canvas element >+ $('#circChart').replaceWith('<canvas id="circChart" width="1000" height="400"></canvas>'); >+ >+ // Draw the chart >+ ctx = $('#circChart').get(0).getContext("2d"); > >- circChart.update(); >+ if ( chartType == "Bar" ) { >+ new Chart(ctx).Line( chartData, {}); >+ $('#chartType').text('Bar'); >+ chartType = "Line"; >+ } else { >+ new Chart(ctx).Bar( chartData, {}); >+ $('#chartType').text('Line'); >+ chartType = "Bar"; >+ } >+ }); >+ //circChart.update(); > </script> > [% END %] > [% INCLUDE 'intranet-bottom.inc' %] >-- >1.7.9.5
You cannot view the attachment while viewing its details because your browser does not support IFRAMEs.
View the attachment on a separate page
.
View Attachment As Diff
View Attachment As Raw
Actions:
View
|
Diff
|
Splinter Review
Attachments on
bug 13219
:
33368
|
33369
|
33370
|
33371
|
33372
|
39777
|
39778
|
39779
| 39780 |
39781
|
39782