2 +--------------------------------------------------------------------+
3 | Copyright CiviCRM LLC. All rights reserved. |
5 | This work is published under the GNU AGPLv3 license with some |
6 | permitted exceptions and without any warranty. For full license |
7 | and copyright information, see https://civicrm.org/licensing |
8 +--------------------------------------------------------------------+
10 {* Display monthly and yearly contributions using Google charts (Bar and Pie) *}
11 {if $hasContributions}
14 <tr class="crm-contribution-form-block-chart">
17 {* display monthly chart *}
18 <div id="chart_by_month"></div>
20 {ts}There were no contributions during the selected year.{/ts}
24 {* display yearly chart *}
25 <div id="chart_by_year"></div>
29 <div class="form-layout-compressed" >
31 <td class="label">{$form.select_year.label}</td><td>{$form.select_year.html}</td>
32 <td class="label">{$form.chart_type.label}</td><td>{$form.chart_type.html}</td>
36 <div class="messages status no-popup">
37 {ts}There are no live contribution records to display.{/ts}
42 {include file="CRM/common/chart.tpl" contriChart=true}
45 <script type="text/javascript">
48 var allData = {/literal}{$chartData}{literal};
50 $.each( allData, function( chartID, chartValues ) {
51 var divName = "chart_" + chartID;
52 createChart( chartID, divName, 300, 300, allData[chartID].object );
55 function byMonthOnClick( barIndex ) {
56 var url = allData.by_month.on_click_urls['url_' + barIndex];
57 if ( url ) window.location.href = url;
60 function byYearOnClick( barIndex ) {
61 var url = allData.by_year.on_click_urls['url_' + barIndex];
62 if ( url ) window.location.href = url;