-
Notifications
You must be signed in to change notification settings - Fork 78
Expand file tree
/
Copy pathAreaGraphWidgetData.php
More file actions
47 lines (42 loc) · 1.46 KB
/
AreaGraphWidgetData.php
File metadata and controls
47 lines (42 loc) · 1.46 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
<?php
namespace Code16\Sharp\Data\Dashboard\Widgets;
use Code16\Sharp\Dashboard\Widgets\Graph\NumberFormatOptions;
use Code16\Sharp\Data\Data;
use Code16\Sharp\Enums\GraphWidgetDisplay;
use Code16\Sharp\Enums\WidgetType;
use Spatie\TypeScriptTransformer\Attributes\LiteralTypeScriptType;
use Spatie\TypeScriptTransformer\Attributes\Optional;
/**
* @internal
*/
final class AreaGraphWidgetData extends Data
{
#[Optional]
public GraphWidgetValueData $value;
public function __construct(
public string $key,
#[LiteralTypeScriptType('"'.WidgetType::Graph->value.'"')]
public WidgetType $type,
#[LiteralTypeScriptType('"'.GraphWidgetDisplay::Area->value.'"')]
public GraphWidgetDisplay $display,
public ?string $title,
public bool $showLegend,
public bool $minimal,
public ?int $ratioX = null,
public ?int $ratioY = null,
public ?int $height = null,
public ?NumberFormatOptions $formatOptions = null,
public bool $displayHorizontalAxisAsTimeline = false,
public bool $enableHorizontalAxisLabelSampling = false,
public bool $curved = false,
public bool $gradient = false,
public bool $stacked = false,
public bool $showStackTotal = false,
public ?string $stackTotalLabel = null,
public ?float $opacity = null,
) {}
public static function from(array $widget): self
{
return new self(...$widget);
}
}