Shorter and Longer Bars

It clearly indicates, you're using that code from KB on top of some other type of Plot function which is in conflict with the Chart Scale properties.

Before moving further, without any haste please go through the User Guide (Press F1). And please care to take few moments of yours to read these threads:

How to use this site
How do I debug my formula?

Thank you