improved chart functionality