setDirections are fine: according to the official documentation, they can be either strings (to be resolved by Google's geocoder Engine on serverside implicitly), or LatLong objects, yours is fine.
origin: LatLng | String,
destination: LatLng | String,
https://developers.google.com/maps/documentation/javascript/directions#DirectionsRequests
However, I guess you want to use just the display logic, as you have a full path defined. Then directions are not necessarily for you, consider using Polylines instead ( https://developers.google.com/maps/documentation/javascript/overlays#PolylineArrays ).
Use any kind of graph visualizer ( Google Charts: https://developers.google.com/chart/ or Raphael JS ( http://g.raphaeljs.com/ or http://raphaeljs.com/analytics.html ) for the elevations.
To answer your comment, try something along this (based on https://developers.google.com/maps/documentation/javascript/overlays#Polylines):
var routePath = new google.maps.Polyline({
path: kids,
strokeColor: "#FF0000",
strokeOpacity: 1.0,
strokeWeight: 2
});
routePath.setMap(map);
elevationPath = kids;
recalcHeight();
});
As I see, first, a route request is made between two points. A route is a set of paths, so for each path, it'll collect the points and put them into a unified array (or a single "path"), and asks for a so-called facade function to draw the Polylines of the route.
After it collected the points, it'll call the elevation service, to tell the elevations along the path, and when this returns, it can draw the chart with the chart API.
However, you already have the path, and you have only a single path: you only have to tell Google Maps to draw the Polylines based on your path (in variable kids), and tell the elevation service to return the elevations for the points along that path.