Skip to content

Commit

Permalink
[#1114] Chart > Axis > LabelStyle 버그
Browse files Browse the repository at this point in the history
###################################
1. 사용자가 rgba로 입력할 경우 입력한 투명도가 아닌 1로 고정되었던 로직 수정
  • Loading branch information
jhee564 committed Mar 30, 2022
1 parent 67b99d6 commit 458e99f
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 3 deletions.
10 changes: 9 additions & 1 deletion src/components/chart/scale/scale.js
Original file line number Diff line number Diff line change
Expand Up @@ -244,7 +244,15 @@ class Scale {
&& (this.options.horizontal === (this.type === 'y'))
&& selectLabelInfo?.dataIndex?.length
&& !selectLabelInfo?.dataIndex?.includes(ix);
ctx.fillStyle = Util.colorStringToRgba(this.labelStyle.color, isBlurredLabel ? 0.1 : 1);

const labelColor = this.labelStyle.color;
let defaultOpacity = 1;

if (Util.getColorStringType(labelColor) === 'RGBA') {
defaultOpacity = Util.getOpacity(labelColor);
}

ctx.fillStyle = Util.colorStringToRgba(labelColor, isBlurredLabel ? 0.1 : defaultOpacity);

let labelPoint;

Expand Down
10 changes: 9 additions & 1 deletion src/components/chart/scale/scale.step.js
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,15 @@ class StepScale extends Scale {
&& (this.options.horizontal === (this.type === 'y'))
&& selectLabelInfo?.dataIndex?.length
&& !selectLabelInfo?.dataIndex?.includes(index);
ctx.fillStyle = Util.colorStringToRgba(this.labelStyle.color, isBlurredLabel ? 0.1 : 1);

const labelColor = this.labelStyle.color;
let defaultOpacity = 1;

if (Util.getColorStringType(labelColor) === 'RGBA') {
defaultOpacity = Util.getOpacity(labelColor);
}

ctx.fillStyle = Util.colorStringToRgba(labelColor, isBlurredLabel ? 0.1 : defaultOpacity);

if (this.type === 'x') {
labelPoint = this.position === 'top' ? offsetPoint - 10 : offsetPoint + 10;
Expand Down
10 changes: 9 additions & 1 deletion src/components/chart/scale/scale.time.category.js
Original file line number Diff line number Diff line change
Expand Up @@ -188,7 +188,15 @@ class TimeCategoryScale extends Scale {
&& (this.options.horizontal === (this.type === 'y'))
&& selectLabelInfo?.dataIndex?.length
&& !selectLabelInfo?.dataIndex?.includes(ix);
ctx.fillStyle = Util.colorStringToRgba(this.labelStyle.color, isBlurredLabel ? 0.1 : 1);

const labelColor = this.labelStyle.color;
let defaultOpacity = 1;

if (Util.getColorStringType(labelColor) === 'RGBA') {
defaultOpacity = Util.getOpacity(labelColor);
}

ctx.fillStyle = Util.colorStringToRgba(labelColor, isBlurredLabel ? 0.1 : defaultOpacity);

let labelPoint;

Expand Down

0 comments on commit 458e99f

Please sign in to comment.