Chart working with logic