[datalogger] Fix crash when generating graph without unit