diff --git a/front/src/components/boxs/chart/ApexChartAreaOptions.js b/front/src/components/boxs/chart/ApexChartAreaOptions.js index a18875760a..31cb56bc68 100644 --- a/front/src/components/boxs/chart/ApexChartAreaOptions.js +++ b/front/src/components/boxs/chart/ApexChartAreaOptions.js @@ -51,7 +51,14 @@ const getApexChartAreaOptions = ({ displayAxes, height, series, colors, locales, }, yaxis: { labels: { - padding: 4 + padding: 4, + formatter: function(value) { + if (Math.abs(value) < 1) { + return value; // For very low values, like crypto prices, use the normal value + } else { + return value.toFixed(2); // 2 decimal places for other values + } + } } }, colors, diff --git a/front/src/components/boxs/chart/ApexChartBarOptions.js b/front/src/components/boxs/chart/ApexChartBarOptions.js index 43705a389e..f26de7d78d 100644 --- a/front/src/components/boxs/chart/ApexChartBarOptions.js +++ b/front/src/components/boxs/chart/ApexChartBarOptions.js @@ -59,7 +59,14 @@ const getApexChartBarOptions = ({ displayAxes, series, colors, locales, defaultL }, yaxis: { labels: { - padding: 4 + padding: 4, + formatter: function(value) { + if (Math.abs(value) < 1) { + return value; // For very low values, like crypto prices, use the normal value + } else { + return value.toFixed(2); // 2 decimal places for other values + } + } } }, colors, diff --git a/front/src/components/boxs/chart/ApexChartLineOptions.js b/front/src/components/boxs/chart/ApexChartLineOptions.js index 990a92ee80..24a9f2365d 100644 --- a/front/src/components/boxs/chart/ApexChartLineOptions.js +++ b/front/src/components/boxs/chart/ApexChartLineOptions.js @@ -50,7 +50,14 @@ const getApexChartLineOptions = ({ height, displayAxes, series, colors, locales, }, yaxis: { labels: { - padding: 4 + padding: 4, + formatter: function(value) { + if (Math.abs(value) < 1) { + return value; // For very low values, like crypto prices, use the normal value + } else { + return value.toFixed(2); // 2 decimal places for other values + } + } } }, colors, diff --git a/front/src/components/boxs/chart/ApexChartStepLineOptions.js b/front/src/components/boxs/chart/ApexChartStepLineOptions.js index b6b695e100..5cac219c71 100644 --- a/front/src/components/boxs/chart/ApexChartStepLineOptions.js +++ b/front/src/components/boxs/chart/ApexChartStepLineOptions.js @@ -49,7 +49,14 @@ const getApexChartStepLineOptions = ({ height, displayAxes, series, colors, loca }, yaxis: { labels: { - padding: 4 + padding: 4, + formatter: function(value) { + if (Math.abs(value) < 1) { + return value; // For very low values, like crypto prices, use the normal value + } else { + return value.toFixed(2); // 2 decimal places for other values + } + } } }, colors,