chart updates when sidebar toggles.