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


PHP CreateDocx::addChart方法代码示例

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


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

示例1: CreateDocx

<?php

//path to  the CreateDocx class within your PHPDocX installation
require_once '../../../classes/CreateDocx.inc';
$docx = new CreateDocx();
$docx->addText('We will now add a 3D line chart with a title to the Word document:');
$data = array('legend' => array('Series 1', 'Series 2', 'Series 3'), 'data 1' => array(10, 7, 5), 'data 2' => array(20, 60, 3), 'data 3' => array(50, 33, 7), 'data 4' => array(25, 0, 14));
$paramsChart = array('data' => $data, 'type' => 'line3DChart', 'title' => 'Three dimensional line chart', 'color' => '2', 'perspective' => '30', 'rotX' => '30', 'rotY' => '30', 'font' => 'Arial', 'chartAlign' => 'center', 'showTable' => 0, 'sizeX' => '12', 'sizeY' => '10', 'legendPos' => 't', 'legendOverlay' => '0', 'haxLabel' => 'Horizontal label', 'vaxLabel' => 'Vertical label', 'haxLabelDisplay' => 'horizontal', 'vaxLabelDisplay' => 'horizontal', 'hgrid' => '3', 'vgrid' => '1');
$docx->addChart($paramsChart);
$docx->addText('And now the same chart in 2D with a different color schem and options:');
$data = array('legend' => array('Series 1', 'Series 2', 'Series 3'), 'data 1' => array(10, 7, 5), 'data 2' => array(20, 60, 3), 'data 3' => array(50, 33, 7), 'data 4' => array(25, 0, 14));
$paramsChart = array('data' => $data, 'type' => 'lineChart', 'color' => '5', 'chartAlign' => 'center', 'showTable' => 0, 'sizeX' => '12', 'sizeY' => '10', 'legendPos' => 'b', 'legendOverlay' => '0', 'haxLabel' => 'X Axis', 'vaxLabel' => 'Y Axis', 'haxLabelDisplay' => 'horizontal', 'vaxLabelDisplay' => 'vertical', 'hgrid' => '3', 'vgrid' => '1');
$docx->addChart($paramsChart);
$docx->createDocx('example_addChart_4');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:14,代码来源:sample_4.php

示例2: array

	  <td>cell_1_4</td>
  </tr>
  <tr>
	  <td>cell_2_3</td>
	  <td>cell_2_4</td>
  </tr>
  <tr>
	  <td>cell_3_1</td>
	  <td>cell_3_2</td>
	  <td>cell_3_3</td>
	  <td>cell_3_4</td>
  </tr>
</table>';
$docx->embedHTML($myHTML, array('tableStyle' => 'MediumGrid3-accent5PHPDOCX'));
$docx->addBreak();
$text = 'We are going to locate three pictures in a row just below this text. And we are going to use Trebuchet MS font to change a little bit :-)';
$paramsText = array('font' => 'Trebuchet MS');
$docx->addText($text, $paramsText);
$images = array('../img/image.png', '../img/image.png', '../img/image.png');
$wordImages = array();
foreach ($images as $image) {
    $paramsImg = array('name' => $image, 'dpi' => 120, 'scaling' => 90, 'spacingTop' => 10, 'spacingBottom' => 10, 'spacingLeft' => 10, 'spacingRight' => 10, 'textWrap' => 1);
    array_push($wordImages, $docx->addElement('addImage', $paramsImg));
}
$paramsTable = array('TBLSTYLEval' => 'NormalTablePHPDOCX');
$valuesTable = array($wordImages);
$docx->addTable($valuesTable, $paramsTable);
$legends = array('legend' => array('sequence 1', 'sequence 2', 'sequence 3'), 'Category 1' => array(9.300000000000001, 2.4, 2), 'Category 2' => array(8.5, 4.4, 1), 'Category 3' => array(6.5, 1.8, 0.5), 'Category 4' => array(8.5, 3, 1), 'Category 5' => array(6, 5, 2.6));
$args = array('data' => $legends, 'type' => 'colBar', 'title' => 'Chart with table', 'sizeX' => 15, 'sizeY' => 15, 'legendPos' => 't', 'border' => 1, 'vgrid' => 1, 'showtable' => 1);
$docx->addChart($args);
$docx->createDocx('../word_documents/example_chart_showtable');
开发者ID:Ezyva2015,项目名称:SMSF-Academy-Wordpress,代码行数:31,代码来源:example12.php


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