working code for chart drawing with proper css