update graph when type changes