Commit 490d0ba2 authored by Sergey Luzyanin's avatar Sergey Luzyanin

fix sparkline styles

parent 98c98d5b
...@@ -261,7 +261,7 @@ ThemeColor.prototype = ...@@ -261,7 +261,7 @@ ThemeColor.prototype =
if(this.theme !== oColor.theme){ if(this.theme !== oColor.theme){
return false; return false;
} }
if(this.tint !== oColor.tint){ if(!AscFormat.fApproxEqual(this.tint, oColor.tint)){
return false; return false;
} }
return true; return true;
...@@ -4848,28 +4848,28 @@ CellArea.prototype = { ...@@ -4848,28 +4848,28 @@ CellArea.prototype = {
}; };
sparklineGroup.prototype.isEqualColors = function(oSparklineGroup){ sparklineGroup.prototype.isEqualColors = function(oSparklineGroup){
if(this.colorSeries && !this.colorSeries.isEqual(oSparklineGroup.colorSeries) || oSparklineGroup.colorSeries){ if(this.colorSeries && !this.colorSeries.isEqual(oSparklineGroup.colorSeries) || !this.colorSeries && oSparklineGroup.colorSeries){
return false; return false;
} }
if(this.colorNegative && !this.colorNegative.isEqual(oSparklineGroup.colorNegative) || oSparklineGroup.colorNegative){ if(this.colorNegative && !this.colorNegative.isEqual(oSparklineGroup.colorNegative) || !this.colorNegative && oSparklineGroup.colorNegative){
return false; return false;
} }
if(this.colorAxis && !this.colorAxis.isEqual(oSparklineGroup.colorAxis) || oSparklineGroup.colorAxis){ /*if(this.colorAxis && !this.colorAxis.isEqual(oSparklineGroup.colorAxis) || !this.colorAxis && oSparklineGroup.colorAxis){
return false; return false;
} }*/
if(this.colorMarkers && !this.colorMarkers.isEqual(oSparklineGroup.colorMarkers) || oSparklineGroup.colorMarkers){ if(this.colorMarkers && !this.colorMarkers.isEqual(oSparklineGroup.colorMarkers) || !this.colorMarkers && oSparklineGroup.colorMarkers){
return false; return false;
} }
if(this.colorFirst && !this.colorFirst.isEqual(oSparklineGroup.colorFirst) || oSparklineGroup.colorFirst){ if(this.colorFirst && !this.colorFirst.isEqual(oSparklineGroup.colorFirst) || !this.colorFirst && oSparklineGroup.colorFirst){
return false; return false;
} }
if(this.colorLast && !this.colorLast.isEqual(oSparklineGroup.colorLast) || oSparklineGroup.colorLast){ if(this.colorLast && !this.colorLast.isEqual(oSparklineGroup.colorLast) || !this.colorLast && oSparklineGroup.colorLast){
return false; return false;
} }
if(this.colorHigh && !this.colorHigh.isEqual(oSparklineGroup.colorHigh) || oSparklineGroup.colorHigh){ if(this.colorHigh && !this.colorHigh.isEqual(oSparklineGroup.colorHigh) || !this.colorHigh && oSparklineGroup.colorHigh){
return false; return false;
} }
if(this.colorLow && !this.colorLow.isEqual(oSparklineGroup.colorLow) || oSparklineGroup.colorLow){ if(this.colorLow && !this.colorLow.isEqual(oSparklineGroup.colorLow) || !this.colorLow && oSparklineGroup.colorLow){
return false; return false;
} }
return true; return true;
...@@ -4879,7 +4879,7 @@ CellArea.prototype = { ...@@ -4879,7 +4879,7 @@ CellArea.prototype = {
{ {
var aRet = []; var aRet = [];
var nStyleIndex = -1; var nStyleIndex = -1;
for(var i = 0; i < 35; ++i){ for(var i = 0; i < 36; ++i){
var oSparklineGroup = this.asc_createSparklineGroupByStyle(i); var oSparklineGroup = this.asc_createSparklineGroupByStyle(i);
if(nStyleIndex === -1 && this.isEqualColors(oSparklineGroup)){ if(nStyleIndex === -1 && this.isEqualColors(oSparklineGroup)){
nStyleIndex = i; nStyleIndex = i;
......
...@@ -308,7 +308,6 @@ var aSparklinesStyles = ...@@ -308,7 +308,6 @@ var aSparklinesStyles =
[ [
[0xFF000000], [0xFF000000],
[0xFF0070C0], [0xFF0070C0],
[0xFF000000],
[0xFF0070C0], [0xFF0070C0],
[0xFF0070C0], [0xFF0070C0],
[0xFF0070C0], [0xFF0070C0],
...@@ -318,7 +317,6 @@ var aSparklinesStyles = ...@@ -318,7 +317,6 @@ var aSparklinesStyles =
[ [
[0xFF376092], [0xFF376092],
[0xFFD00000], [0xFFD00000],
[0xFF000000],
[0xFFD00000], [0xFFD00000],
[0xFFD00000], [0xFFD00000],
[0xFFD00000], [0xFFD00000],
...@@ -332,13 +330,11 @@ var aSparklinesStyles = ...@@ -332,13 +330,11 @@ var aSparklinesStyles =
[0xFF000000], [0xFF000000],
[0xFF000000], [0xFF000000],
[0xFF000000], [0xFF000000],
[0xFF000000],
[0xFF000000] [0xFF000000]
], ],
[ [
[0xFF5F5F5F], [0xFF5F5F5F],
[0xFFFFB620], [0xFFFFB620],
[0xFF000000],
[0xFFD70077], [0xFFD70077],
[0xFF5687C2], [0xFF5687C2],
[0xFF359CEB], [0xFF359CEB],
...@@ -348,7 +344,6 @@ var aSparklinesStyles = ...@@ -348,7 +344,6 @@ var aSparklinesStyles =
[ [
[0xFF5687C2], [0xFF5687C2],
[0xFFFFB620], [0xFFFFB620],
[0xFF000000],
[0xFFD70077], [0xFFD70077],
[0xFF777777], [0xFF777777],
[0xFF359CEB], [0xFF359CEB],
...@@ -358,7 +353,6 @@ var aSparklinesStyles = ...@@ -358,7 +353,6 @@ var aSparklinesStyles =
[ [
[0xFFC6EFCE], [0xFFC6EFCE],
[0xFFFFC7CE], [0xFFFFC7CE],
[0xFF000000],
[0xFF8CADD6], [0xFF8CADD6],
[0xFFFFDC47], [0xFFFFDC47],
[0xFFFFEB9C], [0xFFFFEB9C],
...@@ -368,7 +362,6 @@ var aSparklinesStyles = ...@@ -368,7 +362,6 @@ var aSparklinesStyles =
[ [
[0xFF00B050], [0xFF00B050],
[0xFFFF0000], [0xFFFF0000],
[0xFF000000],
[0xFF0070C0], [0xFF0070C0],
[0xFFFFC000], [0xFFFFC000],
[0xFFFFC000], [0xFFFFC000],
...@@ -378,7 +371,6 @@ var aSparklinesStyles = ...@@ -378,7 +371,6 @@ var aSparklinesStyles =
[ [
[3, 0], [3, 0],
[9, 0], [9, 0],
[0xFF000000],
[8, 0], [8, 0],
[4, 0], [4, 0],
[5, 0], [5, 0],
...@@ -388,7 +380,6 @@ var aSparklinesStyles = ...@@ -388,7 +380,6 @@ var aSparklinesStyles =
[ [
[1, 0], [1, 0],
[9, 0], [9, 0],
[0xFF000000],
[8, 0], [8, 0],
[4, 0], [4, 0],
[5, 0], [5, 0],
......
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