How to make external label size fit text or at least change label dimensions

i’m willing to make my DSR element label text to fit the text provided programmatically.
In the code below, I tried to change label width and height, but it is not working.

const newBounds = { x: in_dsr.x - in_dsr.width*2.5, y: in_dsr.y, width: in_dsr.width*4, height: in_dsr.height };
modeling.updateLabel(in_dsr, inputs_array[i], newBounds);

The position in newBounds does place the element at given x,y but width,height do not change the label.
What am I missing?
Thank you


What problem are you trying to solve? Labels automatically resizing to fit their content is the default behavior.

My DSR labels do not automatically resize to fit the content I provide programmatically.
I’ve decided to use the newBounds variable because I’ve the necessity to place the labels on the left side of the DSR elements.
As you can see above labels do not resize.

This is happening also without providing the newBounds variable,
modeling.updateLabel(in_dsr, inputs_array[i]);


the label is placed below the DSR and it is not resizing according to text size.
What’s the issue? Am I missing some steps?
Thank you