mirror of
https://github.com/makeplane/plane
synced 2024-06-14 14:31:34 +00:00
fix: scope and demand line graph y axis values (#1563)
This commit is contained in:
parent
5e1f0a2604
commit
c71a2137e6
@ -9,12 +9,7 @@ type Props = {
|
|||||||
defaultAnalytics: IDefaultAnalyticsResponse;
|
defaultAnalytics: IDefaultAnalyticsResponse;
|
||||||
};
|
};
|
||||||
|
|
||||||
export const AnalyticsYearWiseIssues: React.FC<Props> = ({ defaultAnalytics }) => {
|
export const AnalyticsYearWiseIssues: React.FC<Props> = ({ defaultAnalytics }) => (
|
||||||
const currentMonth = new Date().getMonth();
|
|
||||||
const startMonth = Math.floor(currentMonth / 3) * 3 + 1;
|
|
||||||
const quarterMonthsList = [startMonth, startMonth + 1, startMonth + 2];
|
|
||||||
|
|
||||||
return (
|
|
||||||
<div className="py-3 border border-custom-border-200 rounded-[10px]">
|
<div className="py-3 border border-custom-border-200 rounded-[10px]">
|
||||||
<h1 className="px-3 text-base font-medium">Issues closed in a year</h1>
|
<h1 className="px-3 text-base font-medium">Issues closed in a year</h1>
|
||||||
{defaultAnalytics.issue_completed_month_wise.length > 0 ? (
|
{defaultAnalytics.issue_completed_month_wise.length > 0 ? (
|
||||||
@ -32,11 +27,9 @@ export const AnalyticsYearWiseIssues: React.FC<Props> = ({ defaultAnalytics }) =
|
|||||||
})),
|
})),
|
||||||
},
|
},
|
||||||
]}
|
]}
|
||||||
customYAxisTickValues={defaultAnalytics.issue_completed_month_wise.map((data) => {
|
customYAxisTickValues={defaultAnalytics.issue_completed_month_wise.map(
|
||||||
if (quarterMonthsList.includes(data.month)) return data.count;
|
(data) => data.count
|
||||||
|
)}
|
||||||
return 0;
|
|
||||||
})}
|
|
||||||
height="300px"
|
height="300px"
|
||||||
colors={(datum) => datum.color}
|
colors={(datum) => datum.color}
|
||||||
curve="monotoneX"
|
curve="monotoneX"
|
||||||
@ -58,5 +51,4 @@ export const AnalyticsYearWiseIssues: React.FC<Props> = ({ defaultAnalytics }) =
|
|||||||
<div className="text-custom-text-200 text-center text-sm py-8">No matching data found.</div>
|
<div className="text-custom-text-200 text-center text-sm py-8">No matching data found.</div>
|
||||||
)}
|
)}
|
||||||
</div>
|
</div>
|
||||||
);
|
);
|
||||||
};
|
|
||||||
|
Loading…
Reference in New Issue
Block a user