/** * Set graph type * @param type $value */ public static function setGraphType($value = NULL) { if (isset($_GET[self::GET_PARAM_GRAPH_TYPE])) { self::$graphType = $_GET[self::GET_PARAM_GRAPH_TYPE]; } else { if (!empty($value)) { self::$graphType = $value; } else { self::$graphType = self::GRAPH_PIE; } } $graph_type = self::graphTypes(); if (!array_key_exists(self::$graphType, $graph_type)) { self::$graphType = array_shift(array_keys($graph_type)); } }
/** * Initialize the properties * @param array $highchart_sql_query_options * @param array $highchart_graph_options */ protected function setVariables(array $highchart_sql_query_options, array $highchart_graph_options) { if (!empty($highchart_sql_query_options)) { $this->highchart_sql_query_options = $highchart_sql_query_options; } if (empty($this->highchart_sql_query_options['sum'])) { $this->highchart_sql_query_options['sum'] = FALSE; } if (empty($this->highchart_sql_query_options['date_field'])) { $this->highchart_sql_query_options['date_field'] = 'date_created'; } if (empty($this->highchart_sql_query_options['condition'])) { $this->highchart_sql_query_options['condition'] = ''; } if (empty($this->highchart_sql_query_options['filters']) || !is_array($this->highchart_sql_query_options['filters'])) { $this->highchart_sql_query_options['filters'] = array(); } if (!empty($highchart_graph_options)) { $this->highchart_graph_options = $highchart_graph_options; } if (empty($this->highchart_graph_options['title'])) { $this->highchart_graph_options['title'] = Lang::t('Reports'); } if (empty($this->highchart_graph_options['y_axis_label'])) { $this->highchart_graph_options['y_axis_label'] = $this->highchart_graph_options['title']; } HighCharts::init(); if (!empty($this->highchart_graph_options['graph_type'])) { HighCharts::setGraphType($this->highchart_graph_options['graph_type']); } $this->highchart_graph_type = HighCharts::getGraphType(); if ($this->highchart_graph_type === HighCharts::GRAPH_PIE) { $this->highchart_series = $this->getHighChartPieSeries(); } else { $this->highchart_series = $this->getHighChartGraphSeries(); } }
public function run() { $graph_type_filter = ''; $date_range_filter = ''; $filter_form = ''; if ($this->showGraphTypeFilter) { $graph_type_filter = CHtml::dropDownList(HighCharts::GET_PARAM_GRAPH_TYPE, HighCharts::getGraphType(), HighCharts::graphTypes(), $this->graphTypeFilterHtmlOptions); } if ($this->showDateRangeFilter) { $date_range_string = $this->date_range_from . ' - ' . $this->date_range_to; $date_range_filter = CHtml::tag('span', array(), $date_range_string); $date_range_hidden = CHtml::hiddenField(HighCharts::GET_PARAM_DATE_RANGE); $date_range_filter_container = CHtml::tag('div', $this->dateRangeFilterHtmlOptions, $date_range_hidden . '<i class="icon-calendar icon-large"></i> ' . $date_range_filter . ' <b class = "caret"></b>'); } if ($this->showFilter) { $filter_form .= CHtml::beginForm(Yii::app()->createUrl($this->owner->route, $this->owner->actionParams), 'get', $this->filterFormHtmlOptions); $filter_form .= Common::myStringReplace($this->filterFormTemplate, array('{graph_type}' => $graph_type_filter, '{date_range}' => $date_range_filter_container)); $filter_form .= CHtml::hiddenField(HighCharts::GET_PARAM_HIGHCHART_FLAG, true); $filter_form .= CHtml::endForm(); } $chart = CHtml::tag('div', array('id' => $this->chartID), '', true); $contents = Common::myStringReplace($this->chartTemplate, array('{filter_form}' => $filter_form, '{chart}' => $chart)); echo CHtml::tag('div', $this->htmlOptions, $contents); }
<h1><?php echo Html::encode($this->title); ?> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Dahsboard</h3> </div> <div class="panel-body"> <?php echo HighCharts::widget(['options' => ['chart' => ['type' => 'column'], 'title' => ['text' => 'Invoice Payment Status Composition'], 'plotOptions' => ['pie' => ['allowPointSelect' => true, 'cursor' => 'pointer', 'dataLabels' => ['enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %']]], 'series' => [['type' => 'pie', 'name' => "Payment Status", "data" => $pie['series']]], 'drilldown' => ['series' => $pie['drilldown']]]]); ?> </div> </div> <?php echo GridView::widget(['id' => 'invoiceGrid', 'dataProvider' => $dataProvider, 'filterModel' => $searchModel, 'showPageSummary' => true, 'columns' => [['class' => 'kartik\\grid\\SerialColumn'], 'kwitansi', ['attribute' => 'partner_id', 'value' => function ($model, $key, $index, $row) { return $model->partner->name; }, 'filterType' => GridView::FILTER_SELECT2, 'filterWidgetOptions' => ['pluginOptions' => ['allowClear' => true, 'minimumInputLength' => 2, 'ajax' => ['url' => Url::to(['service/search-customer']), 'dataType' => 'json', 'data' => new JsExpression('function(term,page){return {search:term}; }'), 'results' => new JsExpression('function(data,page){ return {results:data.results}; }')], 'initSelection' => new JsExpression('function (element, callback) { var id=$(element).val(); if (id !== "") { $.ajax("' . Url::to(['service/search-customer']) . '&id=" + id, { dataType: "json" }).done(function(data) { callback(data.results); }
<?php use miloschuman\highcharts\Highcharts; \miloschuman\highcharts\HighchartsAsset::register($this)->withScripts(['highstock', 'modules/exporting', 'modules/drilldown']); #for drill down foreach ($charts as $chart) { // print_r(\yii\helpers\Json::encode($pie['drillDown'])); echo HighCharts::widget(['options' => ['title' => ['text' => 'Prospect In Year'], 'chart' => [], 'plotOptions' => ['pie' => ['allowPointSelect' => true, 'cursor' => 'pointer', 'dataLabels' => ['enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %']]], 'xAxis' => ['type' => 'category'], 'series' => $chart['series'], 'plotOptions' => ['series' => ['cursor' => 'pointer', 'events' => ['click' => new \yii\web\JsExpression('function(e){ chart.showLoading(\'Please Wait...\'); console.log(e.point.id); jQuery.get("' . \yii\helpers\Url::to(['sales-activity/get-chart-prospect-by-customer']) . '",{"param":e.point.id},function(data){ chart.addSeriesAsDrilldown(e.point,jQuery.parseJSON(data)); chart.hideLoading(); }); chart.hideLoading(); }')]]]]]); }
print '</td>'; // Web print '<td id="label">'.$langs->trans('Web').'</td><td id="value">'; print dol_print_url($soc->url); print '</td></tr>'; $var=!$var; print '</table>'; print '</td>'; print '<td valign="top" width="50%" class="notopnoright">'; if($conf->highcharts->enabled && $user->rights->highcharts->read ) { $langs->load("highcharts@highCharts"); $graph = new HighCharts($db); $graph->height = '300px'; $graph->socid = $soc->id; $graph->label = $langs->trans("ActivityHistory"); if($user->rights->highcharts->all) $graph->mine=0; $graph->graphTaskDone(0,0,1); } print '</td>'; print '</tr>'; print '</table>'; print '</div>'; dol_htmloutput_mesg($mesg);
use miloschuman\highcharts\Highcharts; \miloschuman\highcharts\HighchartsAsset::register($this)->withScripts(['highstock', 'modules/exporting', 'modules/drilldown']); #for drill down if ($charts && $charts['pie']) { foreach ($charts['pie'] as $pie) { // print_r(\yii\helpers\Json::encode($pie['drillDown'])); echo HighCharts::widget(['options' => ['title' => ['text' => $pie['title']], 'chart' => ['events' => ['drilldown' => new \yii\web\JsExpression('function(e){ chart.setTitle({text: "' . $pie['drillDownTitle'] . '"}); console.log("' . $pie['drillDownTitle'] . '"); console.log(e.point.condition); chart.showLoading(\'Please Wait...\'); jQuery.get("' . \yii\helpers\Url::to(['sales-activity/get-drill-down']) . '",jQuery.parseJSON(e.point.condition),function(data){ chart.addSeriesAsDrilldown(e.point,jQuery.parseJSON(data)); chart.hideLoading(); }); /*chart.addSeriesAsDrilldown(e.point,{ name:"Drilled Drill", type:"pie", data:[ ["Point 1",100], ["Point 2",80], ["Point 3",10], ] });*/ }'), 'drillup' => new \yii\web\JsExpression('function(e){ chart.setTitle({text: "' . $pie['title'] . '"}); }')]], 'plotOptions' => ['pie' => ['allowPointSelect' => true, 'cursor' => 'pointer', 'dataLabels' => ['enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %']]], 'xAxis' => ['type' => 'category'], 'series' => [['type' => 'pie', 'name' => "Customer Activity Composition", "data" => $pie['series']]], 'drilldown' => ['series' => $pie['drillDown']]]]); } }
?> <?php ?> <?php if (isset($resGrid) && $resGrid) { ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Invoice Released Composition By Sales Man</h3> </div> <div class="panel-body"> <?php echo HighCharts::widget(['options' => ['title' => ['text' => 'Invoice Released Composition'], 'plotOptions' => ['pie' => ['allowPointSelect' => true, 'cursor' => 'pointer', 'dataLabels' => ['enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %']]], 'series' => [['type' => 'pie', 'name' => "Order Receive Composition", "data" => $pie['series']]]]]); ?> </div> </div> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Summary Invoice Released<?php echo $title['between']; ?> </h3> </div> <div class="panel-body"> <?php echo GridView::widget(['id' => 'salesManAchievement', 'tableOptions' => ['id' => 'salesManAchievementTbl'], 'dataProvider' => $resGrid['dataProvider'], 'showPageSummary' => true, 'columns' => $resGrid['columns']]); ?>
print $thirdparty_static->getLibStatus(); print "</td>"; print "</tr>\n"; $i++; } $db->free(); print "</table><br>"; /* Print Graph */ if($conf->highcharts->enabled && $user->rights->highcharts->read && $conf->societe->enabled && $conf->categorie->enabled) { dol_include_once("/highCharts/class/highCharts.class.php"); $langs->load("highcharts@highCharts"); $graph=new HighCharts($db); $graph->width="100%"; $graph->height="300px"; $graph->name="graphPriority"; $graph->label=$langs->trans("graphPriorityTiers"); if($user->rights->highcharts->all && $user->rights->societe->client->voir) $graph->mine=0; $graph->graphPriorityTiers(); } } } else { dol_print_error($db);
echo $year; ?> </a> <?php $start = 2014; $end = date('Y'); $items = []; for ($iYear = $start; $iYear <= $end; $iYear++) { $items[] = ['label' => $iYear, 'url' => ['', 'year' => $iYear]]; } echo Dropdown::widget(['items' => $items]); ?> </span> </h1> <?php // echo $this->render('_search', ['model' => $searchModel]); ?> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Target Vs Actual</h3> </div> <div class="panel-body"> <?php echo HighCharts::widget(['id' => 'stackedChartSalesAchievement', 'options' => ['title' => 'Target Achievement', 'chart' => ['type' => 'column'], 'xAxis' => ['type' => 'category'], 'plotOptions' => ['column' => ['grouping' => false, 'shadow' => false, 'borderWidth' => 0]], 'yAxis' => [['min' => 0, 'title' => ['text' => 'Employees'], 'title' => ['text' => 'Sales Man'], 'title' => ['text' => 'Values'], 'opposite' => true]], 'series' => $chart['series']]]); ?> </div> </div> </div>
$parameters=array(); $action=''; $reshook=$hookmanager->executeHooks('addStatisticLine',$parameters,$object,$action); // Note that $action and $object may have been modified by some hooks print '</table>'; print end_box(); } if ($conf->agenda->enabled && $user->rights->agenda->myactions->read && $conf->highcharts->enabled && $user->rights->highcharts->read) { print start_box($langs->trans("Action"),"eight","16-Cog-4.png"); dol_include_once("/highCharts/class/highCharts.class.php"); $langs->load("highcharts@highCharts"); $graph=new HighCharts($db); $graph->width="100%"; $graph->height="250px"; $graph->name="ActionsToDo"; $graph->label=$langs->trans("ActionsToDo"); if($user->rights->highcharts->all) { $graph->mine=0; } $graph->eisenhower(); print end_box(); } print '</div>'; /*
<div class="oe_form"> <header></header> </div> <div class="oe_form_sheetbg"> <div class="oe_form_sheet oe_form_sheet_width"> <div style="width:100%; float:left;"> <div class="subjudul">DASHBOARD</div> <a data-pjax="0" title="Reset Activity" href="<?php echo \yii\helpers\Url::to(['site/dashboard']); ?> " class="btn btn-default right" style="margin-right:10px;"><i class="glyphicon glyphicon-repeat"></i></a> </div> <div style="clear:both"></div> <div style="width:50%; float:left"> <?php echo Highcharts::widget(['options' => ['chart' => ['type' => 'column'], 'title' => ['text' => 'Report Weekly Status'], 'subtitle' => ['text' => 'Weekly Status'], 'xAxis' => ['categories' => ['Jan', 'Feb', 'Mar', 'Apr', 'May', 'Jun', 'Jul', 'Aug', 'Sep', 'Oct', 'Nov', 'Dec']], 'yAxis' => ['min' => 0, 'title' => ['text' => 'Total Project']], 'tooltip' => ['headerFormat' => '<span style="font-size:10px">{point.key}</span><table>', 'footerFormat' => '</table>', 'shared' => true, 'useHTML' => true], 'plotOptions' => ['column' => ['pointPadding' => 0.2, 'borderWidth' => 0]], 'series' => [['name' => 'Tokyo', 'data' => [49.9, 71.5, 106.4, 129.2, 144.0, 176.0, 135.6, 148.5, 216.4, 194.1, 95.59999999999999, 54.4]], ['name' => 'New York', 'data' => [83.59999999999999, 78.8, 98.5, 93.40000000000001, 106.0, 84.5, 105.0, 104.3, 91.2, 83.5, 106.6, 92.3]], ['name' => 'London', 'data' => [48.9, 38.8, 39.3, 41.4, 47.0, 48.3, 59.0, 59.6, 52.4, 65.2, 59.3, 51.2]], ['name' => 'Berlin', 'data' => [42.4, 33.2, 34.5, 39.7, 52.6, 75.5, 57.4, 60.4, 47.6, 39.1, 46.8, 51.1]]]]]); ?> </div> <div style="width:50%; float:left;"> <?php echo HighCharts::widget(['options' => ['title' => ['text' => 'Report Sales Project'], 'plotOptions' => ['pie' => ['allowPointSelect' => true, 'cursor' => 'pointer', 'dataLabels' => ['enabled' => true, 'format' => '<b>{point.name}</b>: {point.percentage:.1f} %']]], 'series' => [['type' => 'pie', 'name' => "Qty Project", 'data' => [['name' => "A", 'y' => 1000], ['name' => "B", 'y' => 900], ['name' => "C", 'y' => 100]]]]]]); ?> </div> <div style="clear:both"></div> </div> </div> </div>
print '<td valign="middle">'; print $langs->trans("NoCategoryYet"); print '</td>'; print '<td> </td>'; print '</table></td>'; print '<td colspan="4"> </td>'; print '</tr>'; } // ----- End of section ----- // -------------------------- print "</table><br>"; /* Print Graph */ if ($conf->highcharts->enabled && $user->rights->highcharts->read && $conf->societe->enabled) { dol_include_once("/highCharts/class/highCharts.class.php"); $langs->load("highcharts@highCharts"); $graph = new HighCharts($db); $graph->width = "100%"; $graph->height = "300px"; $graph->name = "graphPriority"; if ($user->rights->highcharts->all && $user->rights->societe->client->voir) { $graph->mine = 0; } if ($_GET["type"] == 2) { $graph->label = $langs->trans("graphPriorityTiers"); $graph->graphPriorityTiers(); } if ($_GET["type"] == 5) { $graph->label = $langs->trans("graphPriorityContacts"); $graph->graphPriorityContacts(); } }
</h1> <div class="panel panel-default"> <div class="panel-heading"> <h3 class="panel-title">Target Vs Actual</h3> </div> <div class="panel-body"> <?php echo HighCharts::widget(['id' => 'stackedChartSalesAchievement', 'options' => ['title' => 'Target Achievement', 'chart' => ['type' => 'column', 'click' => ['click' => new \yii\web\JsExpression('function(e){ /*console.log(e.point.condition); chart.showLoading(\'Please Wait...\');*/ /*$(this).toggleClass(\'modal\'); $(\'.chart\', this).highcharts().reflow();*/ }')]], 'xAxis' => ['type' => 'category', 'labels' => ['formatter' => new \yii\web\JsExpression('function(){ return \'<a href="' . \yii\helpers\Url::to(['executive-summary-by-sales-man', 'year' => $year]) . '&gid=\'+this.value+\'">\'+this.value+\'</a>\'; }')]], 'tooltip' => ['valuePrefix' => 'Rp', 'shared' => true], 'plotOptions' => ['column' => ['grouping' => false, 'shadow' => false, 'borderWidth' => 0], 'series' => ['cursor' => 'pointer', 'point' => ['events' => ['click' => new \yii\web\JsExpression('function(e){ chart.showLoading(\'Please Wait...\'); // console.log(e.point.name); jQuery.get("' . \yii\helpers\Url::to(['account-invoice/get-ess-group-detail']) . '",{"group":e.point.name,"series":this.series.name},function(data){ chart.addSeriesAsDrilldown(e.point,jQuery.parseJSON(data)); chart.hideLoading(); }); // chart.addSeriesAsDrilldown(e.point,jQuery.parseJSON("[{\\"name\\":\\"Ytd Target\\",\\"data\\":[\\"7750000000\\",null],\\"stack\\":0},{\\"name\\":\\"Actual\\",\\"data\\":[\\"360414450.0000\\",\\"107701754.6000\\"],\\"stack\\":0}]")); chart.hideLoading(); }')]]]], 'series' => $chart['series'], 'drilldown' => ['series' => []]]]); ?> </div> </div> </div>
print '<td rowspan="2"><input type="submit" value="' . $langs->trans("Search") . '" class="button"></td></tr>'; print '<tr ' . $bc[$var] . '><td nowrap>' . $langs->trans("Other") . ':</td><td><input type="text" class="flat" name="sall" size="18"></td>'; print '</tr>'; print "</table></form>\n"; print "<br>"; } $NBMAX = 3; $max = 3; /* * Prospects par status * */ if ($conf->highcharts->enabled && $user->rights->highcharts->read) { dol_include_once("/highCharts/class/highCharts.class.php"); $langs->load("highcharts@highCharts"); $graph = new HighCharts($db); $graph->width = "100%"; $graph->height = "300px"; $graph->name = "ProspectionStatus"; $graph->label = $langs->trans("ProspectionStatus"); if ($user->rights->highcharts->all) { $graph->mine = 0; } $graph->ProspectStatus(); } //print '<br>'; $prospect = new Prospect($db); $prospect->ProspectStatus(); /* * Last modified customers or prospects */