update analyst estimate graph
This commit is contained in:
parent
7179a6aaee
commit
d3a6d608f5
@ -213,7 +213,7 @@
|
|||||||
|
|
||||||
// Normalize the data if needed (not required in this case, but leaving it here for reference)
|
// Normalize the data if needed (not required in this case, but leaving it here for reference)
|
||||||
|
|
||||||
let currentYearSuffix = new Date().getFullYear().toString().slice(-2);
|
let currentYearSuffix = new Date().getFullYear()?.toString().slice(-2);
|
||||||
let searchString = `FY${currentYearSuffix}`;
|
let searchString = `FY${currentYearSuffix}`;
|
||||||
let currentYearIndex = dates?.findIndex((date) => date === searchString);
|
let currentYearIndex = dates?.findIndex((date) => date === searchString);
|
||||||
|
|
||||||
@ -287,7 +287,6 @@
|
|||||||
val: val,
|
val: val,
|
||||||
})) || [];
|
})) || [];
|
||||||
}
|
}
|
||||||
|
|
||||||
const growthList = dates?.map((date) => {
|
const growthList = dates?.map((date) => {
|
||||||
const fy = parseInt(date.replace("FY", ""), 10); // Extract numeric FY value
|
const fy = parseInt(date.replace("FY", ""), 10); // Extract numeric FY value
|
||||||
const listToUse =
|
const listToUse =
|
||||||
@ -301,7 +300,6 @@
|
|||||||
const growth = listToUse?.find((r) => r.FY === fy); // Find matching FY
|
const growth = listToUse?.find((r) => r.FY === fy); // Find matching FY
|
||||||
return growth ? growth?.growth : null; // Return growth or null if not found
|
return growth ? growth?.growth : null; // Return growth or null if not found
|
||||||
});
|
});
|
||||||
|
|
||||||
const option = {
|
const option = {
|
||||||
silent: true,
|
silent: true,
|
||||||
tooltip: {
|
tooltip: {
|
||||||
@ -324,6 +322,38 @@
|
|||||||
color: "#fff",
|
color: "#fff",
|
||||||
},
|
},
|
||||||
},
|
},
|
||||||
|
tooltip: {
|
||||||
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
|
formatter: function (params) {
|
||||||
|
// Get the timestamp from the first parameter
|
||||||
|
const timestamp = params[0].axisValue;
|
||||||
|
|
||||||
|
// Sort the params array to arrange High, Avg, Low
|
||||||
|
const sortedParams = params.sort((a, b) => {
|
||||||
|
const order = { High: 0, Avg: 1, Low: 2 };
|
||||||
|
return order[a.seriesName] - order[b.seriesName];
|
||||||
|
});
|
||||||
|
|
||||||
|
// Initialize result with timestamp
|
||||||
|
let result = timestamp + "<br/>";
|
||||||
|
|
||||||
|
// Loop through each sorted series data
|
||||||
|
sortedParams.forEach((param) => {
|
||||||
|
result +=
|
||||||
|
param.seriesName + ": " + abbreviateNumber(param.value) + "<br/>";
|
||||||
|
});
|
||||||
|
|
||||||
|
return result;
|
||||||
|
},
|
||||||
|
},
|
||||||
|
|
||||||
yAxis: [
|
yAxis: [
|
||||||
{
|
{
|
||||||
type: "value",
|
type: "value",
|
||||||
@ -543,6 +573,13 @@
|
|||||||
],
|
],
|
||||||
tooltip: {
|
tooltip: {
|
||||||
trigger: "axis",
|
trigger: "axis",
|
||||||
|
hideDelay: 100,
|
||||||
|
borderColor: "#969696", // Black border color
|
||||||
|
borderWidth: 1, // Border width of 1px
|
||||||
|
backgroundColor: "#313131", // Optional: Set background color for contrast
|
||||||
|
textStyle: {
|
||||||
|
color: "#fff", // Optional: Text color for better visibility
|
||||||
|
},
|
||||||
formatter: (params) => {
|
formatter: (params) => {
|
||||||
const dataIndex = params[0].dataIndex;
|
const dataIndex = params[0].dataIndex;
|
||||||
const mainValue = params[0].value;
|
const mainValue = params[0].value;
|
||||||
|
|||||||
@ -185,7 +185,7 @@
|
|||||||
{/each}
|
{/each}
|
||||||
</tr><tr class="border-b border-gray-600 last:border-0"
|
</tr><tr class="border-b border-gray-600 last:border-0"
|
||||||
><td class="whitespace-nowrap px-1 py-[3px] text-left">Avg</td>
|
><td class="whitespace-nowrap px-1 py-[3px] text-left">Avg</td>
|
||||||
{#each avgGrowthList?.filter((item) => item.FY >= 24) as item, index}
|
{#each avgGrowthList?.filter((item) => item.FY >= 25) as item, index}
|
||||||
<td class="px-1 py-[3px] text-sm sm:text-[1rem]">
|
<td class="px-1 py-[3px] text-sm sm:text-[1rem]">
|
||||||
{#if index !== 0}
|
{#if index !== 0}
|
||||||
{#if userTier !== "Pro" && index >= avgDataList?.length - 2}
|
{#if userTier !== "Pro" && index >= avgDataList?.length - 2}
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user