图示
甘特图代码
import matplotlib. pyplot as plt
import numpy as npclass ProjectEmement : def __init__ ( self, name_, starttime_: float , endtime_: float , fact_endtime_: float , grade_, rootlist_: list , keylist_: list , isover_= - 1 ) : self. name = name_self. starttime = starttime_self. endtime = endtime_self. fact_endtime = fact_endtime_self. grade = grade_self. rootlist = rootlist_self. keylist = keylist_self. isover = isover_self. preprocess( ) pass def preprocess ( self) : self. starttime = min ( self. starttime, self. endtime) self. fact_endtime = max ( self. starttime, self. fact_endtime) self. costtime = self. fact_endtime - self. starttimepass class GanttImage : def __init__ ( self, elementlist_: list ) : self. elementlist = elementlist_self