当前位置: 首页>>代码示例>>PHP>>正文


PHP Report::setChart方法代码示例

本文整理汇总了PHP中Report::setChart方法的典型用法代码示例。如果您正苦于以下问题:PHP Report::setChart方法的具体用法?PHP Report::setChart怎么用?PHP Report::setChart使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Report的用法示例。


在下文中一共展示了Report::setChart方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: makeSummationWithDrillDownReport

 public static function makeSummationWithDrillDownReport()
 {
     $report = new Report();
     $report->setDescription('A test summation report with drill down description');
     $report->setModuleClassName('ReportsTestModule');
     $report->setName('A test summation report with drill down');
     $report->setType(Report::TYPE_SUMMATION);
     $report->setOwner(Yii::app()->user->userModel);
     $report->setFiltersStructure('1');
     $report->setCurrencyConversionType(Report::CURRENCY_CONVERSION_TYPE_BASE);
     $filter = new FilterForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $filter->attributeIndexOrDerivedType = 'string';
     $filter->value = '123';
     $filter->operator = OperatorRules::TYPE_EQUALS;
     $report->addFilter($filter);
     $groupBy = new GroupByForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $groupBy->attributeIndexOrDerivedType = 'owner__User';
     $groupBy->axis = 'x';
     $report->addGroupBy($groupBy);
     $displayAttribute = new DisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'owner__User';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'Count';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'currencyValue__Summation';
     $report->addDisplayAttribute($displayAttribute);
     $drillDownDisplayAttribute = new DrillDownDisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $drillDownDisplayAttribute->attributeIndexOrDerivedType = 'string';
     $report->addDrillDownDisplayAttribute($drillDownDisplayAttribute);
     $drillDownDisplayAttribute = new DrillDownDisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $drillDownDisplayAttribute->attributeIndexOrDerivedType = 'hasOne___name';
     $report->addDrillDownDisplayAttribute($drillDownDisplayAttribute);
     $drillDownDisplayAttribute = new DrillDownDisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $drillDownDisplayAttribute->attributeIndexOrDerivedType = 'currencyValue';
     $report->addDrillDownDisplayAttribute($drillDownDisplayAttribute);
     $drillDownDisplayAttribute = new DrillDownDisplayAttributeForReportForm('ReportsTestModule', 'ReportModelTestItem', $report->getType());
     $drillDownDisplayAttribute->attributeIndexOrDerivedType = 'date';
     $report->addDrillDownDisplayAttribute($drillDownDisplayAttribute);
     $chart = new ChartForReportForm();
     $chart->type = 'Pie2D';
     $chart->firstSeries = 'owner__User';
     $chart->firstRange = 'currencyValue__Summation';
     $report->setChart($chart);
     $savedReport = new SavedReport();
     SavedReportToReportAdapter::resolveReportToSavedReport($report, $savedReport);
     $saved = $savedReport->save();
     if (!$saved) {
         throw new FailedToSaveModelException();
     }
     return $savedReport;
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:53,代码来源:SavedReportTestHelper.php

示例2: resolveChart

 /**
  * @param array $data
  * @param Report $report
  */
 protected static function resolveChart($data, Report $report)
 {
     if ($report->getType() != Report::TYPE_SUMMATION) {
         return;
     }
     $moduleClassName = $report->getModuleClassName();
     if ($moduleClassName != null) {
         $modelClassName = $moduleClassName::getPrimaryModelName();
         $adapter = ModelRelationsAndAttributesToSummationReportAdapter::make($moduleClassName, $modelClassName, $report->getType());
         $seriesDataAndLabels = ReportUtil::makeDataAndLabelsForSeriesOrRange($adapter->getAttributesForChartSeries($report->getGroupBys(), $report->getDisplayAttributes()));
         $rangeDataAndLabels = ReportUtil::makeDataAndLabelsForSeriesOrRange($adapter->getAttributesForChartRange($report->getDisplayAttributes()));
     } else {
         $seriesDataAndLabels = array();
         $rangeDataAndLabels = array();
     }
     $chart = new ChartForReportForm($seriesDataAndLabels, $rangeDataAndLabels);
     if (null != ($chartData = ArrayUtil::getArrayValue($data, 'ChartForReportForm'))) {
         $chart->setAttributes($chartData);
     }
     $report->setChart($chart);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:25,代码来源:DataToReportUtil.php

示例3: makeOpportunitiesByStage

 public static function makeOpportunitiesByStage()
 {
     $report = new Report();
     $report->setModuleClassName('OpportunitiesModule');
     $report->setName('Opportunities by Stage');
     $report->setType(Report::TYPE_SUMMATION);
     $report->setOwner(Yii::app()->user->userModel);
     $report->setFiltersStructure('');
     $report->setCurrencyConversionType(Report::CURRENCY_CONVERSION_TYPE_BASE);
     $groupBy = new GroupByForReportForm('OpportunitiesModule', 'Opportunity', $report->getType());
     $groupBy->attributeIndexOrDerivedType = 'stage';
     $groupBy->axis = 'x';
     $report->addGroupBy($groupBy);
     $displayAttribute = new DisplayAttributeForReportForm('OpportunitiesModule', 'Opportunity', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'stage';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('OpportunitiesModule', 'Opportunity', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'Count';
     $report->addDisplayAttribute($displayAttribute);
     $displayAttribute = new DisplayAttributeForReportForm('OpportunitiesModule', 'Opportunity', $report->getType());
     $displayAttribute->attributeIndexOrDerivedType = 'amount__Summation';
     $report->addDisplayAttribute($displayAttribute);
     $chart = new ChartForReportForm();
     $chart->type = 'Column2D';
     $chart->firstSeries = 'stage';
     $chart->firstRange = 'amount__Summation';
     $report->setChart($chart);
     $savedReport = new SavedReport();
     SavedReportToReportAdapter::resolveReportToSavedReport($report, $savedReport);
     //set explicit
     $saved = $savedReport->save();
     assert('$saved');
     $explicitReadWriteModelPermissions = ExplicitReadWriteModelPermissionsUtil::makeBySecurableItem($savedReport);
     $explicitReadWriteModelPermissions->addReadWritePermitable(Group::getByName(Group::EVERYONE_GROUP_NAME));
     $success = ExplicitReadWriteModelPermissionsUtil::resolveExplicitReadWriteModelPermissions($savedReport, $explicitReadWriteModelPermissions);
     assert('$success');
     $saved = $savedReport->save();
     assert('$saved');
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:39,代码来源:ReportsDemoDataMaker.php

示例4: testGetSecondSeriesDisplayLabelByKey

 public function testGetSecondSeriesDisplayLabelByKey()
 {
     $data = array();
     $secondSeriesValueData = array();
     $secondSeriesDisplayLabels = array('abc', 'def');
     $secondSeriesValueCount = 5;
     $chart = new ChartForReportForm();
     $chart->type = 'Bar2D';
     $chart->firstSeries = 'dropDown';
     $chart->firstRange = 'float__Summation';
     $chart->secondSeries = 'radioDropDown';
     $chart->secondRange = 'integer__Summation';
     $report = new Report();
     $report->setChart($chart);
     $adapter = new ReportDataProviderToAmChartMakerAdapter($report, $data, $secondSeriesValueData, $secondSeriesDisplayLabels, $secondSeriesValueCount);
     $this->assertEquals('def', $adapter->getSecondSeriesDisplayLabelByKey(1));
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:17,代码来源:ReportDataProviderToAmChartMakerAdapterTest.php


注:本文中的Report::setChart方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。