Skip to content

Commit

Permalink
fix(graph): Set precision to one digit after the comma for the main g…
Browse files Browse the repository at this point in the history
…raph
  • Loading branch information
annelhote committed Dec 19, 2024
1 parent d8a7d78 commit 8f7d2be
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 6 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -207,10 +207,10 @@ function useGetData(
const year3 = getObservationLabel(observationYears?.[0], intl);
const year2 = getObservationLabel(observationYears?.[1], intl);
const year1 = year2 - 1;
const value1 = dataGraph2[1]?.data.slice(-1)?.[0]?.y.toFixed(0) || 0;
const value1 = dataGraph2[1]?.data.slice(-1)?.[0]?.y.toFixed(1) || 0;
const value2 = dataGraph1?.series[0]?.data
.find((item) => item.name === year3)
?.y.toFixed(0) || 0;
?.y.toFixed(1) || 0;
const healthPublicationsLabel = capitalize(
intl.formatMessage({ id: 'app.publications.health' }),
);
Expand All @@ -230,8 +230,8 @@ function useGetData(
),
observationDate: dataGraph2[0]?.name,
observationDate4: dataGraph2[3]?.name,
oaYMinusOne4: dataGraph2[3]?.data.slice(-1)?.[0]?.y.toFixed(0) || 0,
oaYMinus4: dataGraph2[0]?.data.slice(-4)?.[0]?.y.toFixed(0) || 0,
oaYMinusOne4: dataGraph2[3]?.data.slice(-1)?.[0]?.y.toFixed(1) || 0,
oaYMinus4: dataGraph2[0]?.data.slice(-4)?.[0]?.y.toFixed(1) || 0,
publicationDate4:
dataGraph2[3]?.data.slice(-1)?.[0]?.publicationDate || 0,
minPublicationDate: dataGraph2[0]?.data?.[0]?.publicationDate || 0,
Expand All @@ -250,7 +250,7 @@ function useGetData(
value2,
healthValue1,
healthValue2,
differenceValue: (value2 - value1).toFixed(0),
differenceValue: (value2 - value1).toFixed(1),
healthDifferenceValue: healthValue2 - healthValue1,
};

Expand Down
2 changes: 1 addition & 1 deletion src/utils/chartOptions.js
Original file line number Diff line number Diff line change
Expand Up @@ -703,7 +703,7 @@ export const chartOptions = {
dataLabels: {
allowOverlap: true,
enabled: true,
format: '{point.y:.0f} %',
format: '{point.y:.1f} %',
style: {
color: getCSSValue('--g-800'),
fontSize: '20px',
Expand Down

0 comments on commit 8f7d2be

Please sign in to comment.