Can I use the color gradient with line chart
Yes, just drag the measure to the color shelf and it will be scattered on that as shown below-