Skip to content

Commit

Permalink
Merge pull request #772 from VEuPathDB/760-SAM-barplot-decimal-points
Browse files Browse the repository at this point in the history
limits decimal points for SAM barplot marker
  • Loading branch information
moontrip committed Jan 16, 2024
2 parents 649349a + 45afcf6 commit a942e92
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion packages/libs/components/src/plots/Barplot.tsx
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,12 @@ const Barplot = makePlotlyPlotComponent(
orientation: orientation === 'vertical' ? 'v' : 'h',
opacity: calculatedOpacity,
type: 'bar',
text: showValues ? el.value : undefined,
// two decimal points for y values
text: showValues
? el.value.map(
(value: number) => `${Number.parseFloat(value.toFixed(2))}`
)
: undefined,
textposition: showValues ? 'auto' : undefined,
marker: {
color: el.color,
Expand Down

0 comments on commit a942e92

Please sign in to comment.