Skip to content

Commit

Permalink
[all] Removed previously used upDownBars inside drawLine class
Browse files Browse the repository at this point in the history
  • Loading branch information
ansaraidarbek committed Feb 11, 2025
1 parent 5f7c5f9 commit 0d421de
Showing 1 changed file with 0 additions and 40 deletions.
40 changes: 0 additions & 40 deletions common/Charts/ChartsDrawer.js
Original file line number Diff line number Diff line change
Expand Up @@ -14375,12 +14375,6 @@ drawStockChart.prototype = {
return;
}

var koffX = trueWidth / numCache.pts.length;

var gapWidth = this.chart.upDownBars && AscFormat.isRealNumber(this.chart.upDownBars.gapWidth) ? this.chart.upDownBars.gapWidth : 150;

var widthBar = koffX / (1 + gapWidth / 100);

var val1, val2, val3, val4, xVal, yVal1, yVal2, yVal3, yVal4, curNumCache, lastNamCache;
for (var i = 0; i < numCache.pts.length; i++) {

Expand Down Expand Up @@ -14427,14 +14421,6 @@ drawStockChart.prototype = {
if (val3 !== null && val4 !== null) {
this.paths.values[i].highLines = this._calculateLine(xVal, yVal4, xVal, yVal3);
}

if (val1 !== null && val4 !== null) {
if (parseFloat(val1) > parseFloat(val4)) {
this.paths.values[i].downBars = this._calculateUpDownBars(xVal, yVal1, xVal, yVal4, widthBar / this.chartProp.pxToMM);
} else {
this.paths.values[i].upBars = this._calculateUpDownBars(xVal, yVal1, xVal, yVal4, widthBar / this.chartProp.pxToMM);
}
}
}
},

Expand All @@ -14452,16 +14438,6 @@ drawStockChart.prototype = {

this.cChartDrawer.drawPath(this.paths.values[i].lowLines, pen, brush);
this.cChartDrawer.drawPath(this.paths.values[i].highLines, pen, brush);

if (this.paths.values[i].downBars) {
brush = this.chart.upDownBars ? this.chart.upDownBars.downBarsBrush : null;
pen = this.chart.upDownBars ? this.chart.upDownBars.downBarsPen : null;
this.cChartDrawer.drawPath(this.paths.values[i].downBars, pen, brush);
} else {
brush = this.chart.upDownBars ? this.chart.upDownBars.upBarsBrush : null;
pen = this.chart.upDownBars ? this.chart.upDownBars.upBarsPen : null;
this.cChartDrawer.drawPath(this.paths.values[i].upBars, pen, brush);
}
}
},

Expand Down Expand Up @@ -14551,22 +14527,6 @@ drawStockChart.prototype = {
}

return {x: centerX, y: centerY};
},

_calculateUpDownBars: function (x, y, x1, y1, width) {
var pathId = this.cChartSpace.AllocPath();
var path = this.cChartSpace.GetPath(pathId);

var pathH = this.chartProp.pathH;
var pathW = this.chartProp.pathW;

path.moveTo((x - width / 2) * pathW, y * pathH);
path.lnTo((x - width / 2) * pathW, y1 * pathH);
path.lnTo((x + width / 2) * pathW, y1 * pathH);
path.lnTo((x + width / 2) * pathW, y * pathH);
path.lnTo((x - width / 2) * pathW, y * pathH);

return pathId;
}
};

Expand Down

0 comments on commit 0d421de

Please sign in to comment.