/** * Returns graph of signups per year dynamics * * @param int $year * @return string */ function web_AnalyticsSignupsMonthGraph($year) { $allmonths = months_array(); $yearcount = zb_AnalyticsSignupsGetCountYear($year); $chartData = array(0 => array(__('Month'), __('Signups'))); $chartOptions = "\n 'focusTarget': 'category',\n 'hAxis': {\n 'color': 'none',\n 'baselineColor': 'none',\n },\n 'vAxis': {\n 'color': 'none',\n 'baselineColor': 'none',\n },\n 'curveType': 'function',\n 'pointSize': 5,\n 'crosshair': {\n trigger: 'none'\n },"; foreach ($yearcount as $eachmonth => $count) { $chartData[] = array($year . '-' . $eachmonth, $count); } $result = wf_gchartsLine($chartData, __('Dynamics of change signups of the year'), '100%', '400px', $chartOptions) . wf_delimiter(); return $result; }
/** * Returns graph of signups per year dynamics * * @param int $year * @return string */ function web_AnalyticsSignupsMonthGraph($year) { $allmonths = months_array(); $yearcount = zb_AnalyticsSignupsGetCountYear($year); $data = __('Month') . ',' . __('Signups') . "\n"; foreach ($yearcount as $eachmonth => $count) { $data .= $year . '-' . $eachmonth . '-' . '-01,' . $count . "\n"; } $result = wf_tag('div', false, '', '') . __('Dynamics of change signups of the year'); $result .= wf_Graph($data, '800', '300', false) . wf_tag('div', true); return $result; }