|
@@ -2548,7 +2548,7 @@ const SpreadJsObj = {
|
|
|
* @param {String} fillColor - 填充颜色
|
|
|
*/
|
|
|
// roundRect方法在Chrome99版本以后才支持
|
|
|
- const drawBarbefore99 = function (canvas, x, y, w, h, r, color) {
|
|
|
+ const drawBarBefore99 = function (canvas, x, y, w, h, r, color) {
|
|
|
canvas.save();
|
|
|
// 设置偏移量
|
|
|
canvas.translate(0.5, 0.5);
|
|
@@ -2576,6 +2576,22 @@ const SpreadJsObj = {
|
|
|
canvas.fill();
|
|
|
canvas.restore();
|
|
|
};
|
|
|
+ const drawSB = function (canvas, x, y, w, h, r, color) {
|
|
|
+ canvas.save();
|
|
|
+ // 设置偏移量
|
|
|
+ canvas.translate(0.5, 0.5);
|
|
|
+ canvas.strokeStyle = color;
|
|
|
+ canvas.beginPath();
|
|
|
+ canvas.moveTo(x, y);
|
|
|
+ canvas.lineTo(x+w, y);
|
|
|
+ canvas.arcTo(x+w, y+h, x, y+h, Math.min(r, w));
|
|
|
+ canvas.lineTo(x, y+h);
|
|
|
+ canvas.lineTo(x, y);
|
|
|
+ canvas.stroke();
|
|
|
+ canvas.fillStyle = color;
|
|
|
+ canvas.fill();
|
|
|
+ canvas.restore();
|
|
|
+ };
|
|
|
const proto = stackedBarCellType.prototype;
|
|
|
/**
|
|
|
* 绘制方法
|
|
@@ -2606,7 +2622,8 @@ const SpreadJsObj = {
|
|
|
let width = ZhCalc.mul(validWidth, bd.percent, 2);
|
|
|
if (width < defaultR) continue;
|
|
|
const top = col.stackedBarCover ? startTop : startTop + height * i + i - 1;
|
|
|
- drawBarbefore99(canvas, left, top, width, height, ZhCalc.mul(height, defaultR, 2), bd.color);
|
|
|
+ //drawBarBefore99(canvas, left, top, width, height, ZhCalc.mul(height, defaultR, 2), bd.color);
|
|
|
+ drawSB(canvas, left, top, width, height, ZhCalc.mul(height, 0.5, 2), bd.color);
|
|
|
}
|
|
|
};
|
|
|
|