Skip to content
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

Merged
merged 13 commits into from
Mar 4, 2024

Conversation

DavidCharif
Copy link
Collaborator

image

chart.mp4

@DavidCharif DavidCharif added the FRONTEND Fronted feature label Feb 28, 2024
@DavidCharif DavidCharif self-assigned this Feb 28, 2024
@DavidCharif DavidCharif added this to the Release 3.0.0 milestone Feb 28, 2024
@DavidCharif DavidCharif linked an issue Feb 28, 2024 that may be closed by this pull request
3 tasks
Comment on lines 40 to 48
type Data = {
labels: string[];
datasets: {
label: string;
data: number[];
backgroundColor: string;
borderColor: string;
}[];
};
Copy link
Collaborator

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) {
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
if (newValue !== null) {
if (newValue) {

</div>
</div>
<BarChart
chartData={dataMapping[currentData.value] || weeklyData}
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
chartData={dataMapping[currentData.value] || weeklyData}
chartData={dataMapping[currentData.value] ?? weeklyData}

Copy link
Collaborator

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.

Comment on lines 152 to 155
const [currentData, setCurrentData] = useState<SelectOption>({
value: 'weekly',
label: 'Weekly',
});
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
const [currentData, setCurrentData] = useState<SelectOption>({
value: 'weekly',
label: 'Weekly',
});
const [currentData, setCurrentData] = useState<SelectOption>(data[0]);

Comment on lines 165 to 167
callback: function (value: number): string {
return `${value}%`;
},
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Suggested change
callback: function (value: number): string {
return `${value}%`;
},
callback: (value: number): string => `${value}%`;,

Is it possible to do like this?

@DavidCharif
Copy link
Collaborator Author

image

dimapopovych
dimapopovych previously approved these changes Feb 29, 2024
@nikita-remeslov nikita-remeslov merged commit ac9d5e5 into development Mar 4, 2024
2 checks passed
@nikita-remeslov nikita-remeslov deleted the task/LIME-199-add-chart-for-progress branch March 4, 2024 16:12
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
FRONTEND Fronted feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Add chart for progress
5 participants