Dashboard examples
Dashboard Excel examples, explained clearly.
Open a focused example to see the implementation path, copy-ready PHP, expected workbook behavior, and the production boundary that matters.
3examples in this category
21focused categories
5implementation paths
01KPI DashboardBuild a dashboard worksheet from summary rows, KPI formulas, styles, and several native charts.
+
Build a dashboard worksheet from summary rows, KPI formulas, styles, and several native charts.
MnbExcel::formula()addChart()styleHeader()<?php
use Mnb\PHPExcel\MnbExcel;
MnbExcel::fromWorkbookArray([
'Data' => $salesRows,
'Dashboard' => [[
'KPI' => 'Revenue',
'Value' => MnbExcel::formula('SUM(Data!D2:D500)', 125000),
]],
])
->withHeader()
->styleHeader(['font' => ['bold' => true, 'color' => '#FFFFFF'], 'fill' => ['color' => '#0E6B4D']])
->addChart('column', 'Revenue by Month', [[
'categories' => 'Data!$A$2:$A$13',
'values' => 'Data!$D$2:$D$13',
]], ['sheet' => 'Dashboard', 'from' => 'D2', 'to' => 'L18'])
->addChart('doughnut', 'Sales Mix', [[
'categories' => 'Data!$B$2:$B$6',
'values' => 'Data!$D$2:$D$6',
]], ['sheet' => 'Dashboard', 'from' => 'D20', 'to' => 'J34'])
->save('kpi-dashboard.xlsx');02SlicersPreserve slicers from a trusted pivot-table template and replace the source data safely.
+
Preserve slicers from a trusted pivot-table template and replace the source data safely.
preservePivotTablesFrom()<?php
use Mnb\PHPExcel\MnbExcel;
MnbExcel::fromWorkbookArray([
'Data' => $salesRows,
'Dashboard' => [],
])
->withHeader()
->preservePivotTablesFrom(
'templates/dashboard-with-slicers.xlsx',
sourceSheet: 'Data',
sourceRange: 'A1:F500'
)
->save('dashboard-with-slicers.xlsx');03Timeline FilterPreserve an existing pivot timeline from a trusted template and rebind its pivot source range.
+
Preserve an existing pivot timeline from a trusted template and rebind its pivot source range.
preservePivotTablesFrom()<?php
use Mnb\PHPExcel\MnbExcel;
MnbExcel::fromWorkbookArray([
'Data' => $datedSalesRows,
'Dashboard' => [],
])
->withHeader()
->preservePivotTablesFrom(
'templates/dashboard-with-timeline.xlsx',
sourceSheet: 'Data',
sourceRange: 'A1:G1000'
)
->save('dashboard-with-timeline.xlsx');Was this guide useful?Use GitHub issues for corrections, missing examples, or unclear behavior.
Open an issue