fix: progress chart to show ideal line only when data is present (#1384)

This commit is contained in:
Aaryan Khandelwal 2023-06-24 00:35:00 +05:30 committed by GitHub
parent ccbe773ce1
commit ddaa8df1c5
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -93,16 +93,19 @@ const ProgressChart: React.FC<Props> = ({ distribution, startDate, endDate, tota
id: "ideal",
color: "#a9bbd0",
fill: "transparent",
data: [
{
x: chartData[0].currentDate,
y: totalIssues,
},
{
x: chartData[chartData.length - 1].currentDate,
y: 0,
},
],
data:
chartData.length > 0
? [
{
x: chartData[0].currentDate,
y: totalIssues,
},
{
x: chartData[chartData.length - 1].currentDate,
y: 0,
},
]
: [],
},
]}
layers={["grid", "markers", "areas", DashedLine, "slices", "points", "axes", "legends"]}