Generic logic for resizing chart

Looping fixed values to decide if we need increase or decrease chart,
instead checking each of then individually