fix: chart y-axis values not showing for values < 1

This commit is contained in:
Pranshu Chittora 2022-05-04 17:52:14 +05:30
parent 1851e76bca
commit dbe9f3a034
No known key found for this signature in database
GPG Key ID: 3A9E57A016CC0626
2 changed files with 2 additions and 5 deletions

View File

@ -160,10 +160,7 @@ function Graph({
ticks: { ticks: {
// Include a dollar sign in the ticks // Include a dollar sign in the ticks
callback(value) { callback(value) {
return getYAxisFormattedValue( return getYAxisFormattedValue(parseFloat(value.toString()), yAxisUnit);
parseInt(value.toString(), 10),
yAxisUnit,
);
}, },
}, },
}, },

View File

@ -6,7 +6,7 @@ export const getYAxisFormattedValue = (
): string => { ): string => {
try { try {
return formattedValueToString( return formattedValueToString(
getValueFormat(format)(value, undefined, undefined, undefined), getValueFormat(format)(value, 1, undefined, undefined),
); );
} catch (error) { } catch (error) {
console.error(error); console.error(error);