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


PHP PHPExcel_Chart_DataSeries::setSmoothLine方法代码示例

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


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

示例1: exportAnualFile


//.........这里部分代码省略.........
     // create medium border around the table
     $objSheet->getStyle('A1:Q' . $column)->getBorders()->getOutline()->setBorderStyle(PHPExcel_Style_Border::BORDER_MEDIUM);
     // create a medium border on the header line
     $objSheet->getStyle('A1:Q1')->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_MEDIUM);
     // autosize the columns
     $objSheet->getColumnDimension('A')->setAutoSize(true);
     $objSheet->getColumnDimension('B')->setAutoSize(true);
     $objSheet->getColumnDimension('C')->setAutoSize(true);
     $objSheet->getColumnDimension('D')->setAutoSize(true);
     $objSheet->getColumnDimension('E')->setAutoSize(true);
     $objSheet->getColumnDimension('F')->setWidth(40);
     $objSheet->getColumnDimension('G')->setAutoSize(true);
     $objSheet->getColumnDimension('H')->setAutoSize(true);
     $objSheet->getColumnDimension('I')->setAutoSize(true);
     $objSheet->getColumnDimension('J')->setAutoSize(true);
     $objSheet->getColumnDimension('K')->setAutoSize(true);
     $objSheet->getColumnDimension('L')->setAutoSize(true);
     $objSheet->getColumnDimension('M')->setAutoSize(true);
     $objSheet->getColumnDimension('N')->setWidth(20);
     $objSheet->getColumnDimension('O')->setWidth(40);
     $objSheet->getColumnDimension('P')->setWidth(40);
     $objSheet->getColumnDimension('Q')->setWidth(40);
     //tabla de resumen en hoja principal
     $column += 5;
     $objSheet->getStyle('G' . $column . ':J' . ($column + 5))->getBorders()->getAllBorders()->setBorderStyle(PHPExcel_Style_Border::BORDER_THIN);
     // create medium border around the table
     $objSheet->getStyle('G' . $column . ':J' . ($column + 5))->getBorders()->getOutline()->setBorderStyle(PHPExcel_Style_Border::BORDER_MEDIUM);
     // create a medium border on the header line
     $objSheet->getStyle('G' . $column . ':J' . $column)->getBorders()->getBottom()->setBorderStyle(PHPExcel_Style_Border::BORDER_MEDIUM);
     $objSheet->getStyle('G' . $column . ':J' . ($column + 6))->getFont()->setBold(true)->setName('Verdana')->setSize(10);
     $objSheet->getStyle('I' . ($column + 1) . ':I' . ($column + 6))->getFont()->setBold(true)->setName('Verdana')->setSize(10)->getColor()->setRGB('FF0000');
     $objSheet->getCell('G' . $column)->setValue('Rating');
     $objSheet->getCell('H' . $column)->setValue('Conteo');
     $objSheet->getCell('I' . $column)->setValue('% Real');
     $objSheet->getCell('J' . $column)->setValue('% Requerida');
     $objSheet->getStyle('I' . ($column + 1) . ':J' . ($column + 6))->getNumberFormat()->applyFromArray(array('code' => PHPExcel_Style_NumberFormat::FORMAT_PERCENTAGE_00));
     $letras = array('A', 'B', 'C', 'D', 'E', '.05', '.15', '.65', '.10', '.05');
     for ($i = 1; $i <= 5; $i++) {
         $objSheet->getCell('G' . ($column + $i))->setValue($letras[$i - 1]);
         $objSheet->getCell('H' . ($column + $i))->setValue('=COUNTIF($M$2:$M$' . ($column - 5) . ',"' . $letras[$i - 1] . '")');
         $objSheet->getCell('I' . ($column + $i))->setValue('=H' . ($column + $i) . '/$H$' . ($column + 6));
         $objSheet->getCell('J' . ($column + $i))->setValue($letras[$i + 4]);
     }
     $column += 6;
     $objSheet->getCell('H' . $column)->setValue('=SUM(H' . ($column - 5) . ':H' . ($column - 1) . ')');
     $objSheet->getCell('I' . $column)->setValue('=SUBTOTAL(9,I' . ($column - 5) . ':I' . ($column - 1) . ')');
     $objSheet->getCell('J' . $column)->setValue('=SUBTOTAL(9,J' . ($column - 5) . ':J' . ($column - 1) . ')');
     //line chart
     $objSheet = $objPHPExcel->createSheet(1);
     $objSheet->setTitle('Resumen');
     //data series label
     $dsl = array(new PHPExcel_Chart_DataSeriesValues('String', 'Junta_Anual!I' . ($column - 6), null, 1), new PHPExcel_Chart_DataSeriesValues('String', 'Junta_Anual!J' . ($column - 6), null, 1));
     //X axis value label
     $xal = array(new PHPExcel_Chart_DataSeriesValues('String', 'Junta_Anual!$G$' . ($column - 5) . ':$G$' . ($column - 1), NULL, 5));
     //data series values
     $dsv = array(new PHPExcel_Chart_DataSeriesValues('Number', 'Junta_Anual!$I$' . ($column - 5) . ':$I$' . ($column - 1), NULL, 5), new PHPExcel_Chart_DataSeriesValues('Number', 'Junta_Anual!$J$' . ($column - 5) . ':$J$' . ($column - 1), NULL, 5));
     //data series values
     $ds = new PHPExcel_Chart_DataSeries(PHPExcel_Chart_DataSeries::TYPE_LINECHART, PHPExcel_Chart_DataSeries::GROUPING_STANDARD, range(0, count($dsv) - 1), $dsl, $xal, $dsv, PHPExcel_Chart_DataSeries::STYLE_SMOOTHMARKER);
     $layout = new PHPExcel_Chart_Layout();
     $ds->setSmoothLine(PHPExcel_Chart_DataSeries::STYLE_SMOOTHMARKER);
     $layout->setShowPercent(TRUE);
     //plot area & legend
     $pa = new PHPExcel_Chart_PlotArea($layout, array($ds));
     $legend = new PHPExcel_Chart_Legend(PHPExcel_Chart_Legend::POSITION_RIGHT, NULL, false);
     //title of chart
     $title = new PHPExcel_Chart_Title('Curva de Desempeño');
     //chart
     $chart = new PHPExcel_Chart('chart1', $title, $legend, $pa, null, 0, NULL, NULL);
     $chart->setTopLeftPosition('B3');
     $chart->setBottomRightPosition('K25');
     $objSheet->addChart($chart);
     $file_name = "Reporte_Anual.xlsx";
     $objWriter->setPreCalculateFormulas(true);
     $objWriter->setIncludeCharts(true);
     /*//output to browser
     		header('Content-Type: application/vnd.ms-excel');
     		header('Content-Disposition: attachment;filename="'.$file_name.'"');
     		header('Cache-Control: max-age=0');
     		$objWriter->save('php://output');*/
     //output to server
     $objWriter->save(getcwd() . "/assets/docs/{$file_name}");
     $this->load->library("email");
     //configuracion para gmail
     $config = array('protocol' => 'smtp', 'smtp_host' => 'ssl://smtp.gmail.com', 'smtp_port' => 465, 'smtp_user' => 'notificaciones.ch@advanzer.com', 'smtp_pass' => 'CapitalAdv16', 'mailtype' => 'html', 'charset' => 'utf-8', 'newline' => "\r\n");
     $this->email->initialize($config);
     $this->email->clear(TRUE);
     $this->email->from('notificaciones.ch@advanzer.com', 'Portal de Evaluación Advanzer-Entuizer');
     $this->email->to("micaela.llano@advanzer.com");
     /*$this->email->to("micaela.llano@advanzer.com");
     		$this->email->bcc(array('jesus.salas@advanzer.com', 'enrique.bernal@advanzer.com'));
     		$this->email->to("antonio.baez@advanzer.com");*/
     $this->email->subject('Reporte de Evaluación para Junta Anual');
     $this->email->message('<h2>Se ha generado el archivo de Reporte de Evaluación para la Junta Anual</h2><hr>');
     $this->email->attach(base_url("assets/docs/{$file_name}"));
     if (!$this->email->send()) {
         var_dump($this->email->print_debugger());
     } else {
         return "Se ha enviado reporte anual";
     }
 }
开发者ID:antonioadvanzer,项目名称:advanzer,代码行数:101,代码来源:Main.php


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