Added additional logic to pie and gauge charts