Commit 30d5d0a2 authored by Alexander.Trofimov's avatar Alexander.Trofimov

fix bug 33553

parent 4ba20ca4
...@@ -674,24 +674,25 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -674,24 +674,25 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
var aSeriesPoints = AscFormat.getPtsFromSeries(oSerie); var aSeriesPoints = AscFormat.getPtsFromSeries(oSerie);
var val_ax_props = new AscCommon.asc_ValAxisSettings(); var val_ax_props = new AscCommon.asc_ValAxisSettings();
var fMinVal = null, fMaxVal = null; var i, fMinVal = null, fMaxVal = null;
if(settings.type !== c_oAscChartTypeSettings.barStackedPer) { if(settings.type !== c_oAscChartTypeSettings.barStackedPer) {
if (oSparklineGroup.minAxisType === Asc.c_oAscSparklineAxisMinMax.Custom && oSparklineGroup.manualMin !== null) { if (oSparklineGroup.minAxisType === Asc.c_oAscSparklineAxisMinMax.Custom && oSparklineGroup.manualMin !== null) {
val_ax_props.putMinValRule(c_oAscValAxisRule.fixed); val_ax_props.putMinValRule(c_oAscValAxisRule.fixed);
val_ax_props.putMinVal(oSparklineGroup.manualMin); val_ax_props.putMinVal(oSparklineGroup.manualMin);
} }
else { else {
val_ax_props.putMinValRule(c_oAscValAxisRule.auto); val_ax_props.putMinValRule(c_oAscValAxisRule.auto);
for (var i = 0; i < aSeriesPoints.length; ++i) { if (c_oAscChartTypeSettings.lineNormal === settings.type) {
if (fMinVal === null) { for (i = 0; i < aSeriesPoints.length; ++i) {
fMinVal = aSeriesPoints[i].val; if (fMinVal === null) {
} fMinVal = aSeriesPoints[i].val;
else { }
if (fMinVal > aSeriesPoints[i].val) { else {
fMinVal = aSeriesPoints[i].val; if (fMinVal > aSeriesPoints[i].val) {
} fMinVal = aSeriesPoints[i].val;
} }
}
}
} }
} }
if (oSparklineGroup.maxAxisType === Asc.c_oAscSparklineAxisMinMax.Custom && oSparklineGroup.manualMax !== null) { if (oSparklineGroup.maxAxisType === Asc.c_oAscSparklineAxisMinMax.Custom && oSparklineGroup.manualMax !== null) {
...@@ -700,16 +701,17 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -700,16 +701,17 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
} }
else { else {
val_ax_props.putMaxValRule(c_oAscValAxisRule.auto); val_ax_props.putMaxValRule(c_oAscValAxisRule.auto);
for (var i = 0; i < aSeriesPoints.length; ++i) { if (c_oAscChartTypeSettings.lineNormal === settings.type) {
if (fMaxVal === null) { for (i = 0; i < aSeriesPoints.length; ++i) {
fMaxVal = aSeriesPoints[i].val; if (fMaxVal === null) {
} fMaxVal = aSeriesPoints[i].val;
else { } else {
if (fMaxVal < aSeriesPoints[i].val) { if (fMaxVal < aSeriesPoints[i].val) {
fMaxVal = aSeriesPoints[i].val; fMaxVal = aSeriesPoints[i].val;
} }
} }
} }
}
} }
if (fMinVal !== null && fMaxVal !== null) { if (fMinVal !== null && fMaxVal !== null) {
if (fMinVal !== fMaxVal) { if (fMinVal !== fMaxVal) {
...@@ -737,8 +739,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -737,8 +739,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
val_ax_props.putMaxVal(1); val_ax_props.putMaxVal(1);
} }
val_ax_props.putTickLabelsPos(Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE); val_ax_props.putTickLabelsPos(Asc.c_oAscTickLabelsPos.TICK_LABEL_POSITION_NONE);
val_ax_props.putInvertValOrder(false); val_ax_props.putInvertValOrder(false);
val_ax_props.putDispUnitsRule(Asc.c_oAscValAxUnits.none); val_ax_props.putDispUnitsRule(Asc.c_oAscValAxUnits.none);
...@@ -746,8 +746,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -746,8 +746,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
val_ax_props.putMinorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE); val_ax_props.putMinorTickMark(Asc.c_oAscTickMark.TICK_MARK_NONE);
val_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto); val_ax_props.putCrossesRule(Asc.c_oAscCrossesRule.auto);
var cat_ax_props = new AscCommon.asc_CatAxisSettings(); var cat_ax_props = new AscCommon.asc_CatAxisSettings();
cat_ax_props.putIntervalBetweenLabelsRule(Asc.c_oAscBetweenLabelsRule.auto); cat_ax_props.putIntervalBetweenLabelsRule(Asc.c_oAscBetweenLabelsRule.auto);
cat_ax_props.putLabelsPosition(Asc.c_oAscLabelsPosition.betweenDivisions); cat_ax_props.putLabelsPosition(Asc.c_oAscLabelsPosition.betweenDivisions);
...@@ -765,7 +763,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou ...@@ -765,7 +763,6 @@ CSparklineView.prototype.initFromSparkline = function(oSparkline, oSparklineGrou
settings.putHorAxisProps(cat_ax_props); settings.putHorAxisProps(cat_ax_props);
AscFormat.DrawingObjectsController.prototype.applyPropsToChartSpace(settings, chart_space); AscFormat.DrawingObjectsController.prototype.applyPropsToChartSpace(settings, chart_space);
var i;
if(!chart_space.spPr) if(!chart_space.spPr)
chart_space.setSpPr(new AscFormat.CSpPr()); chart_space.setSpPr(new AscFormat.CSpPr());
......
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