直方图

类型

  1. \Vtiful\Kernel\Chart::CHART_COLUMN

图表

php-excel

实例

  1. $config = ['path' => './tests'];
  2.  
  3. $fileObject = new \Vtiful\Kernel\Excel($config);
  4.  
  5. $fileObject = $fileObject->fileName('tutorial.xlsx');
  6. $fileHandle = $fileObject->getHandle();
  7.  
  8. $chart = new \Vtiful\Kernel\Chart($fileHandle, \Vtiful\Kernel\Chart::CHART_COLUMN);
  9.  
  10. $chartResource = $chart->series('Sheet1!$A$1:$A$5')
  11. ->series('Sheet1!$B$1:$B$5')
  12. ->series('Sheet1!$C$1:$C$5')
  13. ->toResource();
  14.  
  15. $filePath = $fileObject->data([
  16. [1, 2, 3],
  17. [2, 4, 6],
  18. [3, 6, 9],
  19. [4, 8, 12],
  20. [5, 10, 15],
  21. ])->insertChart(0, 3, $chartResource)->output();