2 +--------------------------------------------------------------------+
3 | CiviCRM version 4.6 |
4 +--------------------------------------------------------------------+
5 | Copyright CiviCRM LLC (c) 2004-2014 |
6 +--------------------------------------------------------------------+
7 | This file is a part of CiviCRM. |
9 | CiviCRM is free software; you can copy, modify, and distribute it |
10 | under the terms of the GNU Affero General Public License |
11 | Version 3, 19 November 2007 and the CiviCRM Licensing Exception. |
13 | CiviCRM is distributed in the hope that it will be useful, but |
14 | WITHOUT ANY WARRANTY; without even the implied warranty of |
15 | MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. |
16 | See the GNU Affero General Public License for more details. |
18 | You should have received a copy of the GNU Affero General Public |
19 | License and the CiviCRM Licensing Exception along |
20 | with this program; if not, contact CiviCRM LLC |
21 | at info[AT]civicrm[DOT]org. If you have questions about the |
22 | GNU Affero General Public License or the licensing of CiviCRM, |
23 | see the CiviCRM license FAQ at http://civicrm.org/licensing |
24 +--------------------------------------------------------------------+
26 {assign var=uploadURL value=$config->imageUploadURL|replace:'/persist/contribute/':'/persist/'|cat:'openFlashChart/'}
27 {* Display weekly,Quarterly,monthly and yearly contributions using pChart (Bar and Pie) *}
28 {if $chartEnabled and $chartSupported}
29 <div class='crm-flashchart'>
33 {if $outputMode eq 'print' OR $outputMode eq 'pdf'}
34 <img src="{$uploadURL|cat:$chartId}.png" />
36 <div id="open_flash_chart_{$uniqueId}"></div>
43 {if !$printOnly} {* NO print section starts *}
45 {include file="CRM/common/openFlashChart.tpl" divId="open_flash_chart_$uniqueId"}
49 <script type="text/javascript">
53 $("input[id$='submit_print'],input[id$='submit_pdf']").bind('click', function(e){
54 // image creator php file path and append image name
55 var url = CRM.url('civicrm/report/chart', 'name=' + '{/literal}{$chartId}{literal}' + '.png');
57 //fetch object and 'POST' image
58 swfobject.getObjectById("open_flash_chart_{/literal}{$uniqueId}{literal}").post_image(url, true, false);
62 function buildChart( ) {
63 var chartData = {/literal}{$openFlashChartData}{literal};
64 cj.each( chartData, function( chartID, chartValues ) {
65 var xSize = eval( "chartValues.size.xSize" );
66 var ySize = eval( "chartValues.size.ySize" );
67 var divName = {/literal}"open_flash_chart_{$uniqueId}"{literal};
69 var loadDataFunction = {/literal}"loadData{$uniqueId}"{literal};
70 createSWFObject( chartID, divName, xSize, ySize, loadDataFunction );
74 function loadData{/literal}{$uniqueId}{literal}( chartID ) {
75 var allData = {/literal}{$openFlashChartData}{literal};
76 var data = eval( "allData." + chartID + ".object" );
77 return JSON.stringify( data );