Fixed clear graph function