-
Notifications
You must be signed in to change notification settings - Fork 5
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
LIME-199: Add chart for progress. #214
LIME-199: Add chart for progress. #214
Conversation
type Data = { | ||
labels: string[]; | ||
datasets: { | ||
label: string; | ||
data: number[]; | ||
backgroundColor: string; | ||
borderColor: string; | ||
}[]; | ||
}; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Change the name of the type
}); | ||
|
||
const handleChange = useCallback((newValue: SingleValue<SelectOption>) => { | ||
if (newValue !== null) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
if (newValue !== null) { | |
if (newValue) { |
</div> | ||
</div> | ||
<BarChart | ||
chartData={dataMapping[currentData.value] || weeklyData} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
chartData={dataMapping[currentData.value] || weeklyData} | |
chartData={dataMapping[currentData.value] ?? weeklyData} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I think it's better to create constant folder for all this data.
const [currentData, setCurrentData] = useState<SelectOption>({ | ||
value: 'weekly', | ||
label: 'Weekly', | ||
}); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
const [currentData, setCurrentData] = useState<SelectOption>({ | |
value: 'weekly', | |
label: 'Weekly', | |
}); | |
const [currentData, setCurrentData] = useState<SelectOption>(data[0]); |
callback: function (value: number): string { | ||
return `${value}%`; | ||
}, |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
callback: function (value: number): string { | |
return `${value}%`; | |
}, | |
callback: (value: number): string => `${value}%`;, |
Is it possible to do like this?
…bsa-winter-2023-2024-lime into task/LIME-199-add-chart-for-progress
chart.mp4