Plotly js labelled bar chart - font size is dependent on height

I created a horizontal bar graph using plotly javascript and I have labelled the graph with text representing height of the bar. Everything works fine as long as I have numbers greater than 2. But when the size is 2, the font size gets much smaller to read. I have attached a snapshot for reference.
Screen Shot 2022-03-01 at 8.02.58 PM