final | |
|---|---|
readonly | |
extends |
AbstractCard |
The Chart artifact's emitted DTO — the outer wrapper that lands as a
direct Group child in the dashboard. Extends {@see AbstractCard} so the
wire output is a sap.f.Card envelope carrying header + content +
layoutData; the content is the {@see ChartCanvas} the provider
composed.
Wire shape:
{
"sap.f.Card": {
"header": { "sap.f.cards.Header": { "title": "...", "subtitle": "..." } },
"content": { "com.laravelui5.core.Chart": { "engine": "echarts", "option": {...} } },
"layoutData": { "sap.f.GridContainerItemLayoutData": { "columns": 4, "rows": 4 } }
}
}
The provider composes the full DTO tree explicitly — same posture as a
Tile provider composing GenericTile → TileContent[] → payload. The
Chart constructor takes the inner {@see ChartCanvas} as a required slot,
not the engine + option pair. This is deliberate: the two-layer
(sap.f.Card outer + com.laravelui5.core.Chart inner) structure that
Phase 4 introduced is visible at every authoring site, not hidden behind
a buildContent() indirection.
Pre-Phase-4 Chart (Core 0.9.33+0.9.34) was the inner engine-rendered
DTO emitting {"com.laravelui5.core.Chart": {...}}. That responsibility
relocated to {@see ChartCanvas} at Phase 4. The PHP class name Chart
stays for the artifact's emitted DTO — what ChartProviderInterface::getChart()
returns; the wire class changes from com.laravelui5.core.Chart (Phase
1–3) to sap.f.Card (Phase 4+). The pre-0.9.37 Chart accepted engine +
option directly and built ChartCanvas internally; 0.9.37 lifted the
canvas into a constructor slot for explicit composition.
Authoring (Core Charts API spec § Composition):
public function getChart(array $boundParams, Ui5ContextInterface $context): Chart
{
return new Chart(
canvas: new ChartCanvas(
engine: 'echarts',
option: [...],
),
layoutData: new GridContainerItemLayoutData(columns: 6, rows: 4),
height: '100%',
);
}
Header (title / subtitle) is auto-populated by {@see \LaravelUi5\Core\Ui5\Dashboard\Emitters\ChartEmitter}
from the artifact's getTitle() / getDescription() when the provider
returns header: null. Providers that need custom headers (status text,
icon, timestamp) construct a {@see Header} and pass it explicitly.
Layout sizing — pass a {@see GridContainerItemLayoutData} via
layoutData to size the cell explicitly. Symmetric with how Tile and
Card carry layoutData; null falls through to UI5's grid-cell default.
| Methods | ||
|---|---|---|
public
|
__construct(
ChartCanvas $canvas,
Header|null $header = null,
HeaderPosition|null $headerPosition = null,
string|null $width = null,
string|null $height = null,
SemanticRole|null $semanticRole = null,
GridContainerItemLayoutData|null $layoutData = null,
array<string, mixed>|null $parameters = null,
Margin|ContentPadding|string|null $class = null,
)
|
# |
public
|
withHeader(?Header $header): self
|
# |
| Methods inherited from LaravelUi5\Core\Ui5\Controls\Sap\F\AbstractCard |
|---|
ui5Class() |
| Methods inherited from LaravelUi5\Core\Ui5\Controls\AbstractControl |
|---|
jsonSerialize() |
| Properties | |||
|---|---|---|---|
public
|
ChartCanvas
|
$canvas
|
# |
| Properties inherited from LaravelUi5\Core\Ui5\Controls\Sap\F\AbstractCard |
|---|
$header, $headerPosition, $width, $height, $semanticRole, $layoutData, $parameters, $class |