Merge pull request #1071 from pranshuchittora/pranshuchittora/fix/chart-y-axis-zero-values

fix: chart y-axis values not showing for values < 1
This commit is contained in:
palash-signoz 2022-05-04 17:55:59 +05:30 committed by GitHub
commit ca4ce0d380
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
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);