fixed code after upgrading XChart dependency