         strongSelf.barChart.notifyDataSetChanged()
         })
       .addDisposableTo(self.disposeBag)
-
-    let rightBarButtonItem = self.navigationItem.rightBarButtonItem!
+  }
+
+  private func setupNavigation() {
+    let rightBarButtonItem = UIBarButtonItem(title: "Configure", style: .plain, target: nil, action: nil)
     rightBarButtonItem.rx.tap
       .subscribe(onNext: { [weak self] in
         guard let strongSelf = self else { return }

  override func viewDidLoad() {
    super.viewDidLoad()

    self.navigationItem.rightBarButtonItem = UIBarButtonItem(title: "Configure", style: .plain, target: nil, action: nil)

    self.setupCharts()
    self.setupBindings()
  }

  override func viewWillAppear(_ animated: Bool) {

        configViewController.delegate = strongSelf
        let navController = UINavigationController(rootViewController: configViewController)
        strongSelf.present(navController, animated: true, completion: nil)
        })
      .addDisposableTo(self.disposeBag)
    self.navigationItem.rightBarButtonItem = rightBarButtonItem
  }

}
