mirror of
https://github.com/blakeblackshear/frigate.git
synced 2024-11-21 19:07:46 +01:00
[stats] Fix tooltip showing as undefined for first tick (#11150)
* Fix tooltip showing as undefined for first tick * Rearrange to simplify diff * Remove offset for mobile
This commit is contained in:
parent
5858eee1fe
commit
5bc9f9a388
@ -37,10 +37,6 @@ export function ThresholdBarGraph({
|
|||||||
|
|
||||||
const formatTime = useCallback(
|
const formatTime = useCallback(
|
||||||
(val: unknown) => {
|
(val: unknown) => {
|
||||||
if (val == 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const date = new Date(updateTimes[Math.round(val as number) - 1] * 1000);
|
const date = new Date(updateTimes[Math.round(val as number) - 1] * 1000);
|
||||||
return date.toLocaleTimeString([], {
|
return date.toLocaleTimeString([], {
|
||||||
hour12: config?.ui.time_format != "24hour",
|
hour12: config?.ui.time_format != "24hour",
|
||||||
@ -111,7 +107,6 @@ export function ThresholdBarGraph({
|
|||||||
tickPlacement: "on",
|
tickPlacement: "on",
|
||||||
labels: {
|
labels: {
|
||||||
rotate: 0,
|
rotate: 0,
|
||||||
offsetX: -18,
|
|
||||||
formatter: formatTime,
|
formatter: formatTime,
|
||||||
},
|
},
|
||||||
axisBorder: {
|
axisBorder: {
|
||||||
@ -302,10 +297,6 @@ export function CameraLineGraph({
|
|||||||
|
|
||||||
const formatTime = useCallback(
|
const formatTime = useCallback(
|
||||||
(val: unknown) => {
|
(val: unknown) => {
|
||||||
if (val == 1) {
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
const date = new Date(updateTimes[Math.round(val as number)] * 1000);
|
const date = new Date(updateTimes[Math.round(val as number)] * 1000);
|
||||||
return date.toLocaleTimeString([], {
|
return date.toLocaleTimeString([], {
|
||||||
hour12: config?.ui.time_format != "24hour",
|
hour12: config?.ui.time_format != "24hour",
|
||||||
@ -354,7 +345,6 @@ export function CameraLineGraph({
|
|||||||
tickPlacement: "on",
|
tickPlacement: "on",
|
||||||
labels: {
|
labels: {
|
||||||
rotate: 0,
|
rotate: 0,
|
||||||
offsetX: isMobileOnly ? -18 : 0,
|
|
||||||
formatter: formatTime,
|
formatter: formatTime,
|
||||||
},
|
},
|
||||||
axisBorder: {
|
axisBorder: {
|
||||||
|
Loading…
Reference in New Issue
Block a user