Improve Custom Line Chart Functionality