Commit fc2bafeb authored by Sergey.Luzyanin's avatar Sergey.Luzyanin

добавлены дополнительные параметры осей для передачи в меню.

git-svn-id: svn://192.168.3.15/activex/AVS/Sources/TeamlabOffice/trunk/OfficeWeb@62014 954022d7-b5bf-4e40-9824-e11837661b57
parent ad65cbf3
...@@ -67,6 +67,25 @@ function removeAllSeriesFromChart(chart) ...@@ -67,6 +67,25 @@ function removeAllSeriesFromChart(chart)
} }
function getMinMaxFromArrPoints(aPoints)
{
if(Array.isArray(aPoints) && aPoints.length > 0)
{
if(isRealObject(aPoints[0]) && isRealNumber(aPoints[0].val) && isRealObject(aPoints[aPoints.length - 1]) && isRealNumber(aPoints[aPoints.length - 1].val))
{
if(aPoints[0].val - aPoints[aPoints.length - 1].val <= 0)
{
return {min: aPoints[0].val, max: aPoints[aPoints.length - 1].val};
}
else
{
return {min: aPoints[aPoints.length - 1].val, max: aPoints[0].val};
}
}
}
return {min: null, max: null};
}
var SCALE_INSET_COEFF = 1.016;//Возможно придется уточнять var SCALE_INSET_COEFF = 1.016;//Возможно придется уточнять
var NEW_WORKSHEET_DRAWING_DOCUMENT = null; var NEW_WORKSHEET_DRAWING_DOCUMENT = null;
...@@ -4275,6 +4294,11 @@ CCatAx.prototype = ...@@ -4275,6 +4294,11 @@ CCatAx.prototype =
if(crossAx) if(crossAx)
{ {
if(isRealNumber(this.maxCatVal))
{
ret.putCrossMaxVal(this.maxCatVal);
}
ret.putCrossMinVal(1);
if(isRealNumber(crossAx.crossesAt)) if(isRealNumber(crossAx.crossesAt))
{ {
ret.putCrossesRule(c_oAscCrossesRule.value); ret.putCrossesRule(c_oAscCrossesRule.value);
...@@ -4283,20 +4307,23 @@ CCatAx.prototype = ...@@ -4283,20 +4307,23 @@ CCatAx.prototype =
else if(crossAx.crosses === CROSSES_MAX) else if(crossAx.crosses === CROSSES_MAX)
{ {
ret.putCrossesRule(c_oAscCrossesRule.maxValue); ret.putCrossesRule(c_oAscCrossesRule.maxValue);
if(isRealNumber(this.maxCatVal))
{
ret.putCrosses(this.maxCatVal);
}
} }
else if(crossAx.crosses === CROSSES_MIN) else if(crossAx.crosses === CROSSES_MIN)
{ {
ret.putCrossesRule(c_oAscCrossesRule.minValue); ret.putCrossesRule(c_oAscCrossesRule.minValue);
ret.putCrosses(1);
} }
else else
{ {
ret.putCrossesRule(c_oAscCrossesRule.auto); ret.putCrossesRule(c_oAscCrossesRule.auto);
ret.putCrosses(1);
} }
} }
if(isRealNumber(this.lblOffset)) if(isRealNumber(this.lblOffset))
ret.putLabelsAxisDistance(this.lblOffset); ret.putLabelsAxisDistance(this.lblOffset);
else else
...@@ -8603,6 +8630,15 @@ CValAx.prototype = ...@@ -8603,6 +8630,15 @@ CValAx.prototype =
ret.putLogScale(false); ret.putLogScale(false);
} }
var oMinMaxOnAxis;
if(this.axPos === AX_POS_L || this.axPos === AX_POS_R)
{
oMinMaxOnAxis = getMinMaxFromArrPoints(this.yPoints);
}
else
{
oMinMaxOnAxis = getMinMaxFromArrPoints(this.xPoints);
}
//настроки максимального значения по оси //настроки максимального значения по оси
if(scaling && isRealNumber(scaling.max)) if(scaling && isRealNumber(scaling.max))
{ {
...@@ -8612,6 +8648,7 @@ CValAx.prototype = ...@@ -8612,6 +8648,7 @@ CValAx.prototype =
else else
{ {
ret.putMaxValRule(c_oAscValAxisRule.auto); ret.putMaxValRule(c_oAscValAxisRule.auto);
ret.putMaxVal(oMinMaxOnAxis.max);
} }
//настройки минимального значения по оси //настройки минимального значения по оси
...@@ -8623,6 +8660,7 @@ CValAx.prototype = ...@@ -8623,6 +8660,7 @@ CValAx.prototype =
else else
{ {
ret.putMinValRule(c_oAscValAxisRule.auto); ret.putMinValRule(c_oAscValAxisRule.auto);
ret.putMaxVal(oMinMaxOnAxis.min);
} }
//настройка ориентации оси //настройка ориентации оси
...@@ -8671,11 +8709,7 @@ CValAx.prototype = ...@@ -8671,11 +8709,7 @@ CValAx.prototype =
else else
ret.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO); ret.putTickLabelsPos(c_oAscTickLabelsPos.TICK_LABEL_POSITION_NEXT_TO);
var crossAx = this.crossAx; var crossAx = this.crossAx;
if(crossAx) if(crossAx)
{ {
//настройки пересечения с другой осью //настройки пересечения с другой осью
...@@ -8687,18 +8721,33 @@ CValAx.prototype = ...@@ -8687,18 +8721,33 @@ CValAx.prototype =
else if(crossAx.crosses === CROSSES_MAX) else if(crossAx.crosses === CROSSES_MAX)
{ {
ret.putCrossesRule(c_oAscCrossesRule.maxValue); ret.putCrossesRule(c_oAscCrossesRule.maxValue);
ret.putCrosses(oMinMaxOnAxis.max);
} }
else if(crossAx.crosses === CROSSES_MIN) else if(crossAx.crosses === CROSSES_MIN)
{ {
ret.putCrossesRule(c_oAscCrossesRule.minValue); ret.putCrossesRule(c_oAscCrossesRule.minValue);
ret.putCrosses(oMinMaxOnAxis.min);
} }
else else
{ {
ret.putCrossesRule(c_oAscCrossesRule.auto); ret.putCrossesRule(c_oAscCrossesRule.auto);
if(isRealNumber(oMinMaxOnAxis.min) && isRealNumber(oMinMaxOnAxis.max))
{
if(0 >= oMinMaxOnAxis.min && 0 <= oMinMaxOnAxis.max)
{
ret.putCrosses(0);
}
else if(oMinMaxOnAxis.min > 0)
{
ret.putCrosses(oMinMaxOnAxis.min);
}
else
{
ret.putCrosses(oMinMaxOnAxis.max);
}
}
} }
} }
return ret; return ret;
}, },
......
...@@ -3529,6 +3529,8 @@ CChartSpace.prototype = ...@@ -3529,6 +3529,8 @@ CChartSpace.prototype =
else else
crosses = 1; crosses = 1;
cat_ax.maxCatVal = string_pts.length;
var cat_ax_orientation = cat_ax.scaling && isRealNumber(cat_ax.scaling.orientation) ? cat_ax.scaling.orientation : ORIENTATION_MIN_MAX; var cat_ax_orientation = cat_ax.scaling && isRealNumber(cat_ax.scaling.orientation) ? cat_ax.scaling.orientation : ORIENTATION_MIN_MAX;
var point_width = rect.w/string_pts.length; var point_width = rect.w/string_pts.length;
var labels_pos = val_ax.tickLblPos; var labels_pos = val_ax.tickLblPos;
...@@ -3693,7 +3695,6 @@ CChartSpace.prototype = ...@@ -3693,7 +3695,6 @@ CChartSpace.prototype =
{ {
for(i = 0; i < string_pts.length; ++i) for(i = 0; i < string_pts.length; ++i)
arr_cat_labels_points[i] = start_point_right - point_interval*i; arr_cat_labels_points[i] = start_point_right - point_interval*i;
} }
else else
{ {
...@@ -3708,7 +3709,6 @@ CChartSpace.prototype = ...@@ -3708,7 +3709,6 @@ CChartSpace.prototype =
{ {
for(i = 0; i < string_pts.length; ++i) for(i = 0; i < string_pts.length; ++i)
arr_cat_labels_points[i] = rect.x + rect.w - point_interval*i; arr_cat_labels_points[i] = rect.x + rect.w - point_interval*i;
} }
else else
{ {
...@@ -3752,7 +3752,6 @@ CChartSpace.prototype = ...@@ -3752,7 +3752,6 @@ CChartSpace.prototype =
for(i = 0; i < string_pts.length; ++i) for(i = 0; i < string_pts.length; ++i)
arr_cat_labels_points[i] = rect.x + rect.w - point_interval/2 - point_interval*i; arr_cat_labels_points[i] = rect.x + rect.w - point_interval/2 - point_interval*i;
} }
val_ax.posX = rect.x + rect.w - point_interval*(crosses-1); val_ax.posX = rect.x + rect.w - point_interval*(crosses-1);
} }
else else
...@@ -4616,6 +4615,9 @@ CChartSpace.prototype = ...@@ -4616,6 +4615,9 @@ CChartSpace.prototype =
else else
crosses = 1; crosses = 1;
cat_ax.maxCatVal = string_pts.length;
var cat_ax_orientation = cat_ax.scaling && isRealNumber(cat_ax.scaling.orientation) ? cat_ax.scaling.orientation : ORIENTATION_MIN_MAX; var cat_ax_orientation = cat_ax.scaling && isRealNumber(cat_ax.scaling.orientation) ? cat_ax.scaling.orientation : ORIENTATION_MIN_MAX;
var labels_pos = val_ax.tickLblPos; var labels_pos = val_ax.tickLblPos;
var cross_between = isRealNumber(val_ax.crossBetween) ? val_ax.crossBetween : CROSS_BETWEEN_BETWEEN; var cross_between = isRealNumber(val_ax.crossBetween) ? val_ax.crossBetween : CROSS_BETWEEN_BETWEEN;
......
...@@ -869,6 +869,8 @@ ...@@ -869,6 +869,8 @@
this.crosses = null; this.crosses = null;
this.labelsPosition = null; this.labelsPosition = null;
this.axisType = c_oAscAxisType.cat; this.axisType = c_oAscAxisType.cat;
this.crossMinVal = null;
this.crossMaxVal = null;
} }
asc_CatAxisSettings.prototype = asc_CatAxisSettings.prototype =
...@@ -977,6 +979,28 @@ ...@@ -977,6 +979,28 @@
return this.labelsPosition; return this.labelsPosition;
}, },
getCrossMinVal: function()
{
return this.crossMinVal;
},
getCrossMaxVal: function()
{
return this.crossMaxVal;
},
putCrossMinVal: function(val)
{
this.crossMinVal = val;
},
putCrossMaxVal: function(val)
{
this.crossMaxVal = val;
},
setDefault: function() setDefault: function()
{ {
this.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.auto); this.putIntervalBetweenLabelsRule(c_oAscBetweenLabelsRule.auto);
...@@ -1003,6 +1027,8 @@ ...@@ -1003,6 +1027,8 @@
prot["putCrosses"] = prot.putCrosses; prot["putCrosses"] = prot.putCrosses;
prot["putAxisType"] = prot.putAxisType; prot["putAxisType"] = prot.putAxisType;
prot["putLabelsPosition"] = prot.putLabelsPosition; prot["putLabelsPosition"] = prot.putLabelsPosition;
prot["putCrossMaxVal"] = prot.putCrossMaxVal;
prot["putCrossMinVal"] = prot.putCrossMinVal;
prot["getIntervalBetweenTick"] = prot.getIntervalBetweenTick; prot["getIntervalBetweenTick"] = prot.getIntervalBetweenTick;
...@@ -1017,6 +1043,8 @@ ...@@ -1017,6 +1043,8 @@
prot["getCrosses"] = prot.getCrosses ; prot["getCrosses"] = prot.getCrosses ;
prot["getAxisType"] = prot.getAxisType ; prot["getAxisType"] = prot.getAxisType ;
prot["getLabelsPosition"] = prot.getLabelsPosition; prot["getLabelsPosition"] = prot.getLabelsPosition;
prot["getCrossMaxVal"] = prot.getCrossMaxVal;
prot["getCrossMinVal"] = prot.getCrossMinVal;
prot["setDefault"] = prot.setDefault; prot["setDefault"] = prot.setDefault;
......
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