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: {
// Include a dollar sign in the ticks
callback(value) {
return getYAxisFormattedValue(
parseInt(value.toString(), 10),
yAxisUnit,
);
return getYAxisFormattedValue(parseFloat(value.toString()), yAxisUnit);
},
},
},

View File

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