Commit aaac5f30 authored by Sergey Luzyanin's avatar Sergey Luzyanin

Сортируем точки в серии по возрастанию

parent 2c71f105
...@@ -646,7 +646,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -646,7 +646,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
else else
{ {
aSeriesPoints.sort(function(a, b){return b.val - a.val;}); aSeriesPoints.sort(function(a, b){return a.val - b.val;});
bSorted = true; bSorted = true;
dMinVal = aSeriesPoints[0].val; dMinVal = aSeriesPoints[0].val;
} }
...@@ -666,7 +666,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -666,7 +666,7 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
{ {
if(!bSorted) if(!bSorted)
{ {
aSeriesPoints.sort(function(a, b){return b.val - a.val;}); aSeriesPoints.sort(function(a, b){return a.val - b.val;});
bSorted = true; bSorted = true;
} }
dMaxVal = aSeriesPoints[aSeriesPoints.length - 1].val; dMaxVal = aSeriesPoints[aSeriesPoints.length - 1].val;
...@@ -794,7 +794,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro ...@@ -794,7 +794,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro
var dMinVal, dMaxVal, bSorted = false; var dMinVal, dMaxVal, bSorted = false;
if(minVal == null) if(minVal == null)
{ {
aSeriesPoints.sort(function(a, b){return b.val - a.val;}); aSeriesPoints.sort(function(a, b){return a.val - b.val;});
bSorted = true; bSorted = true;
dMinVal = aSeriesPoints[0].val; dMinVal = aSeriesPoints[0].val;
} }
...@@ -807,7 +807,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro ...@@ -807,7 +807,7 @@ CSparklineView.prototype.setMinMaxValAx = function(minVal, maxVal, oSparklineGro
{ {
if(!bSorted) if(!bSorted)
{ {
aSeriesPoints.sort(function(a, b){return b.val - a.val;}); aSeriesPoints.sort(function(a, b){return a.val - b.val;});
bSorted = true; bSorted = true;
} }
dMaxVal = aSeriesPoints[aSeriesPoints.length - 1].val; dMaxVal = aSeriesPoints[aSeriesPoints.length - 1].val;
......
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