fix grid when switching between lines<->bar