hey, welcome to this forum !
that is a bit of an all-encompassing question… do you have experience with writing code ?
the most basic thing to do imho is to draw a rect() and use a variable to change its width.
next step would be to use a FloatList or IntList, if you have a timeline where that value changes and use that.
pseudo:
float barLength;
//in draw()
recht(0,0,barLength,15);
FloatList lengthValue= new FloatList (0,2.2,13,24.7,32,56.1,66);
int count = 0;
//in draw()
recht(0,0, lengthValue.get(count),15);
count++;
that’s a bit oversimplified, you need to make sure that you don’t exceed the numbers of items in the list when count gets too big.
but that is just a really most basic pattern to show what I mean.
if you have one bar, then you can - of course - draw more, either working with arrays or lists. finally it would be probably worth having a class