Skip to content

Commit a942e92

Browse files
authored
Merge pull request #772 from VEuPathDB/760-SAM-barplot-decimal-points
limits decimal points for SAM barplot marker
2 parents 649349a + 45afcf6 commit a942e92

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

packages/libs/components/src/plots/Barplot.tsx

+6-1
Original file line numberDiff line numberDiff line change
@@ -121,7 +121,12 @@ const Barplot = makePlotlyPlotComponent(
121121
orientation: orientation === 'vertical' ? 'v' : 'h',
122122
opacity: calculatedOpacity,
123123
type: 'bar',
124-
text: showValues ? el.value : undefined,
124+
// two decimal points for y values
125+
text: showValues
126+
? el.value.map(
127+
(value: number) => `${Number.parseFloat(value.toFixed(2))}`
128+
)
129+
: undefined,
125130
textposition: showValues ? 'auto' : undefined,
126131
marker: {
127132
color: el.color,

0 commit comments

Comments
 (0)