Using the Javascript API (4.x) you can add the ElevationProfile widget to a Web Scene. The example that you pointed to does exactly that. Look at the 'sandbox' to see the exact code. In order to use this you will need to put the file (a single HTML page for this example) into a and internet management service (Internet Information Server (IIS) for Windows, or Apache for Linux) in order for the page to be rendered and accessible from a browser. But everything to accomplish what you are asking is in that example.