Commit 5e93744d authored by GoshaZotov's avatar GoshaZotov

delete repeated points

parent 7899ae08
......@@ -11581,17 +11581,29 @@ drawSurfaceChart.prototype =
var y = 1/(points.length)*(summY);
var sortArray = [];
var repeatePoint = [];
var nIndividualPoints = 0;
for(var i = 0; i < points.length; i++)
{
sortArray[i] = {tan: Math.atan2(points[i].x - x, points[i].y - y), point: points[i]};
var tan = Math.atan2(points[i].x - x, points[i].y - y);
if(!repeatePoint[tan])
{
sortArray[i] = {tan: tan, point: points[i]};
repeatePoint[tan] = 1;
nIndividualPoints++;
}
}
var path = null
if(nIndividualPoints > 2)
{
sortArray.sort (function sortArr(a, b)
{
return b.tan - a.tan;
});
var path = this.cChartDrawer.calculatePathFacesArray(sortArray, true);
path = this.cChartDrawer.calculatePathFacesArray(sortArray, true);
}
return path
},
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment