Did you pre-calculate the elevation in ArcGIS Pro and then published the lines? I guess you can also do that client-side by manipulating the z values in the polyline geometry, but it's probably better to save the computation for something else if they have values that never change.