<?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(); }')]]]]]); }
<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 ?> <?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']]); ?>
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']]]]); } }
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>
<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>
</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>