ui fix
This commit is contained in:
parent
b90db7eb53
commit
84abc75a9d
@ -213,7 +213,6 @@
|
|||||||
function getPlotOptions() {
|
function getPlotOptions() {
|
||||||
isLoading = true;
|
isLoading = true;
|
||||||
let dates = marketTideData?.map((item) => item?.timestamp);
|
let dates = marketTideData?.map((item) => item?.timestamp);
|
||||||
|
|
||||||
const priceList = marketTideData?.map((item) => item?.close);
|
const priceList = marketTideData?.map((item) => item?.close);
|
||||||
const netCallPremList = marketTideData?.map(
|
const netCallPremList = marketTideData?.map(
|
||||||
(item) => item?.net_call_premium,
|
(item) => item?.net_call_premium,
|
||||||
@ -310,17 +309,24 @@
|
|||||||
data: dates,
|
data: dates,
|
||||||
axisLabel: {
|
axisLabel: {
|
||||||
color: "#fff",
|
color: "#fff",
|
||||||
formatter: (value) => {
|
formatter: (value, index) => {
|
||||||
const timePart = value.split(" ")[1];
|
const [datePart, timePart] = value.split(" ");
|
||||||
let [hours, minutes] = timePart.split(":").map(Number);
|
let [hours, minutes] = timePart.split(":").map(Number);
|
||||||
hours = minutes >= 30 ? hours + 1 : hours;
|
|
||||||
minutes = 0;
|
// Only show labels at 30-minute intervals (XX:00 and XX:30)
|
||||||
|
if (minutes % 30 === 0) {
|
||||||
const amPm = hours >= 12 ? "PM" : "AM";
|
const amPm = hours >= 12 ? "PM" : "AM";
|
||||||
hours = hours % 12 || 12;
|
hours = hours % 12 || 12;
|
||||||
return `${hours}:00 ${amPm}`;
|
return minutes === 0
|
||||||
},
|
? `${hours} ${amPm}`
|
||||||
|
: `${hours}:30 ${amPm}`;
|
||||||
|
}
|
||||||
|
return "";
|
||||||
|
},
|
||||||
|
interval: 29, // Show label every 30 minutes (29 intervals between)
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
|
||||||
{
|
{
|
||||||
type: "category",
|
type: "category",
|
||||||
gridIndex: 1,
|
gridIndex: 1,
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user