/** * @see DashletGenericChart::display() */ public function display() { $currency_symbol = $GLOBALS['sugar_config']['default_currency_symbol']; if ($GLOBALS['current_user']->getPreference('currency')) { $currency = new Currency(); $currency->retrieve($GLOBALS['current_user']->getPreference('currency')); $currency_symbol = $currency->symbol; } require "modules/Charts/chartdefs.php"; $chartDef = $chartDefs['outcome_by_month']; require_once 'include/SugarCharts/SugarChart.php'; $sugarChart = new SugarChart(); $sugarChart->setProperties('', translate('LBL_OPP_SIZE', 'Charts') . ' ' . $currency_symbol . '1' . translate('LBL_OPP_THOUSANDS', 'Charts'), $chartDef['chartType']); $sugarChart->base_url = $chartDef['base_url']; $sugarChart->group_by = $chartDef['groupBy']; $sugarChart->url_params = array(); $sugarChart->getData($this->constructQuery()); $sugarChart->is_currency = true; $sugarChart->data_set = $sugarChart->sortData($sugarChart->data_set, 'm', false, 'sales_stage', true, true); $xmlFile = $sugarChart->getXMLFileName($this->id); $sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML()); return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />'; }
public function display() { global $current_user, $sugar_config; require "modules/Charts/chartdefs.php"; $chartDef = $chartDefs['lead_source_by_outcome']; require_once 'include/SugarCharts/SugarChart.php'; $sugarChart = new SugarChart(); $sugarChart->is_currency = true; $currency_symbol = $sugar_config['default_currency_symbol']; if ($current_user->getPreference('currency')) { $currency = new Currency(); $currency->retrieve($current_user->getPreference('currency')); $currency_symbol = $currency->symbol; } $subtitle = translate('LBL_OPP_SIZE', 'Charts') . " " . $currency_symbol . "1" . translate('LBL_OPP_THOUSANDS', 'Charts'); $sugarChart->setProperties('', $subtitle, $chartDef['chartType']); $sugarChart->base_url = $chartDef['base_url']; $sugarChart->group_by = $chartDef['groupBy']; $sugarChart->url_params = array(); if (count($this->lsbo_ids) > 0) { $sugarChart->url_params['assigned_user_id'] = array_values($this->lsbo_ids); } $sugarChart->getData($this->constuctQuery()); $sugarChart->data_set = $sugarChart->sortData($sugarChart->data_set, 'lead_source', true, 'sales_stage', true, true); $xmlFile = $sugarChart->getXMLFileName($this->id); $sugarChart->saveXMLFile($xmlFile, $sugarChart->generateXML()); return $this->getTitle('<div align="center"></div>') . '<div align="center">' . $sugarChart->display($this->id, $xmlFile, '100%', '480', false) . '</div><br />'; }