Skip to content

Commit a7a87a7

Browse files
authored
Using charts examples failed to render charts. (#245)
Added setTopLeftPosition() and setBottomRightPosition() to Charts examples which seems to resolve the issue.
1 parent 857f2ed commit a7a87a7

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

3.1/exports/charts.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,9 @@ $plot = new PlotArea(null, [$series]);
1818

1919
$legend = new Legend();
2020
$chart = new Chart('chart name', new Title('chart title'), $legend, $plot);
21+
22+
$chart->setTopLeftPosition('D1');
23+
$chart->setBottomRightPosition('K12');
2124
```
2225

2326
You can view all available properties for Charts on the [PhpSpreadsheet docs](https://phpoffice.github.io/PhpSpreadsheet/namespaces/phpoffice-phpspreadsheet-chart.html).
@@ -48,6 +51,9 @@ class InvoicesExport implements WithCharts
4851
$legend = new Legend();
4952
$chart = new Chart('chart name', new Title('chart title'), $legend, $plot);
5053

54+
$chart->setTopLeftPosition('D1');
55+
$chart->setBottomRightPosition('K12');
56+
5157
return $chart;
5258
}
5359
}
@@ -77,8 +83,14 @@ class InvoicesExport implements WithCharts
7783
$plot = new PlotArea(null, [$series]);
7884

7985
$legend = new Legend();
86+
8087
$chart = new Chart('chart name', new Title('chart title'), $legend, $plot);
88+
$chart->setTopLeftPosition('D1');
89+
$chart->setBottomRightPosition('K12');
90+
8191
$chart2 = new Chart('chart 2 name', new Title('chart 2 title'), $legend, $plot);
92+
$chart2->setTopLeftPosition('D13');
93+
$chart2->setBottomRightPosition('K24');
8294

8395
return [$chart, $chart2];
8496
}

0 commit comments

Comments
 (0)