automatically determine number of bars + color