/*+*********************************************************************************** * The contents of this file are subject to the vtiger CRM Public License Version 1.0 * ("License"); You may not use this file except in compliance with the License * The Original Code is: vtiger CRM Open Source * The Initial Developer of the Original Code is vtiger. * Portions created by vtiger are Copyright (C) vtiger. * All Rights Reserved. *************************************************************************************/ var vtJqPlotInterface = function() { this.legendPlacement = 'outside'; /* refer: http://www.jqplot.com/docs/files/jqplot-core-js.html#Legend.placement */ this.renderPie = function() { this.element.jqplot([this.data['chartData']], { seriesDefaults:{ renderer:jQuery.jqplot.PieRenderer, rendererOptions: { showDataLabels: true, dataLabels: 'value' } }, legend: { show: true, location: 'e' }, title : this.data['title'] }); } this.renderBar = function() { this.element.jqplot(this.data['chartData'] , { title: this.data['title'], animate: !$.jqplot.use_excanvas, seriesDefaults:{ renderer:jQuery.jqplot.BarRenderer, rendererOptions: { showDataLabels: true, dataLabels: 'value', barDirection : 'vertical' }, pointLabels: {show: true,edgeTolerance: -15} }, axes: { xaxis: { tickRenderer: jQuery.jqplot.CanvasAxisTickRenderer, renderer: jQuery.jqplot.CategoryAxisRenderer, ticks: this.data['labels'], tickOptions: { angle: -45 } }, yaxis: { min:0, max: this.data['yMaxValue'], tickOptions: { formatString: '%d' }, pad : 1.2 } }, legend: { show : (this.data['data_labels']) ? true:false, location : 'e', placement : this.legendPlacement, showLabels : (this.data['data_labels']) ? true:false, showSwatch : (this.data['data_labels']) ? true:false, labels : this.data['data_labels'] } }); } this.renderFunnel = function() { var labels = new Array(); var dataInfo = JSON.parse(this.data); for(var i=0; i