Data input

Function Prototype

1
Series(string $value,[ string $categories])
Copied!

string $value

Chart worksheet and cell span where individual category data is located
1
Sheet1 ! $A$1 : $A$5
2
Worksheet ! Start cell : End cell
Copied!

string $categories

Category Name

example

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();
Copied!
Last modified 2yr ago