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