wip
This commit is contained in:
1 parent
b4379efb82
commit
4f63a4ef2c
2 files changed
+38
-17
No files matched your search
@@ -22,23 +22,6 @@ class ChartMovingAverageEvent extends ChartWidget
|
|||||||
'legend' => [
|
'legend' => [
|
||||||
'display' => false,
|
'display' => false,
|
||||||
],
|
],
|
||||||
'tooltip' => [
|
|
||||||
'callbacks' => [
|
|
||||||
'label' => RawJs::make(<<<'JS'
|
|
||||||
function(context) {
|
|
||||||
let label = context.dataset.label || '';
|
|
||||||
|
|
||||||
if (label) {
|
|
||||||
label += ': ';
|
|
||||||
}
|
|
||||||
if (context.parsed.y !== null) {
|
|
||||||
label += new Intl.NumberFormat('en-US', { style: 'currency', currency: 'USD' }).format(context.parsed.y);
|
|
||||||
}
|
|
||||||
return label;
|
|
||||||
}
|
|
||||||
JS),
|
|
||||||
],
|
|
||||||
],
|
|
||||||
],
|
],
|
||||||
'interaction' => [
|
'interaction' => [
|
||||||
'intersect' => false,
|
'intersect' => false,
|
||||||
@@ -67,4 +50,32 @@ class ChartMovingAverageEvent extends ChartWidget
|
|||||||
{
|
{
|
||||||
return 'line';
|
return 'line';
|
||||||
}
|
}
|
||||||
|
|
||||||
|
// protected function getOptions(): array|RawJs|null
|
||||||
|
// {
|
||||||
|
// return [
|
||||||
|
// 'plugins' => [
|
||||||
|
// 'legend' => [
|
||||||
|
// 'display' => display,
|
||||||
|
// ],
|
||||||
|
// 'tooltip' => [
|
||||||
|
// 'callbacks' => [
|
||||||
|
// 'label' => RawJs::make(<<<'JS'
|
||||||
|
// function(context) {
|
||||||
|
// let label = context.dataset.label || '';
|
||||||
|
|
||||||
|
// if (label) {
|
||||||
|
// label += ': ';
|
||||||
|
// }
|
||||||
|
// return label;
|
||||||
|
// }
|
||||||
|
// JS),
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
|
// 'interaction' => [
|
||||||
|
// 'intersect' => false,
|
||||||
|
// ],
|
||||||
|
// ];
|
||||||
|
// }
|
||||||
}
|
}
|
||||||
@@ -25,6 +25,16 @@ class ChartPunctualEvent extends ChartWidget
|
|||||||
'interaction' => [
|
'interaction' => [
|
||||||
'intersect' => false,
|
'intersect' => false,
|
||||||
],
|
],
|
||||||
|
// 'scales' => [
|
||||||
|
// 'xAxes' => [
|
||||||
|
// 'type' => 'time',
|
||||||
|
// 'time' => [
|
||||||
|
// 'tooltipFormat' => 'MM/DD/YYYY',
|
||||||
|
// 'displayFormats' => 'HH:mm:ss',
|
||||||
|
// ],
|
||||||
|
|
||||||
|
// ],
|
||||||
|
// ],
|
||||||
];
|
];
|
||||||
|
|
||||||
public function getDescription(): ?string
|
public function getDescription(): ?string
|
||||||
|
|||||||
Reference in new issue
Block a user