You can install a third-party app, like Sleep as Android, that will detect sleep duration and write that data to Google Fit. Cardiogram can then read the sleep data from Google Fit and display sleep duration within the Cardiogram app! Some other apps you can use are Pillow and Sleep Cycle.