draw polyline within from loop

In success part of jsonp i recieve lots of polyline. Precisely x,y coordinates of them i want to draw polylines using those cordinates. How should it be done? My part of code is this:

success: function(data){
                             
  for (var i=0; i < data.length; i++){
    for (var l=0; l<data[i].POINTS.length; l++){
      var entity = new Cesium.Polyline();
      entity.position = Cesium.Cartesian3.fromDegrees(data[i].POINTS[l].p_x, data.POINTS[i].p_y);
      entity.label = new Cesium.LabelGraphics();
      entity.label.verticalOrigin = Cesium.VerticalOrigin.TOP;
      viewer.entities.add(entity);
    }
  }

}

I don't know how to produce position using x,y coordinate within for loop.

Help please! Thank you in front!

Hello,

Take a look at our polyline example: http://cesiumjs.org/Cesium/Apps/Sandcastle/index.html?src=Polyline.html&label=Geometries

You can put your coordinate points in an array ([x1, y1, x2, y2, x3, y3, …]) and pass that array to the Cesium.Cartesian3.fromDegreesArray function

Best,

Hannah