Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[#1606] Chart > Indicator > Dash 스타일 추가 #1607

Merged
merged 3 commits into from
Feb 14, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions docs/views/barChart/api/barChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -334,6 +334,7 @@ const chartOptions = {
| --- | ---- | ----- | --- | ----------|
| use | Boolean | true | indicator 사용 여부 | |
| color | HexCode(String) | '#EE7F44' | 색상 | |
| segments | Array | null | dash 간격 | [6, 2] |

#### maxTip
| 이름 | 타입 | 디폴트 | 설명 | 종류(예시) |
Expand Down
1 change: 1 addition & 0 deletions docs/views/lineChart/api/lineChart.md
Original file line number Diff line number Diff line change
Expand Up @@ -288,6 +288,7 @@ const chartOptions = {
| --- | ---- | ----- | --- | ----------|
| use | Boolean | true | indicator 사용 여부 | |
| color | Hex, RGB, RGBA Code(String) | '#EE7F44' | 색상 | |
| segments | Array | null | dash 간격 | [6, 2] |

#### maxTip
| 이름 | 타입 | 디폴트 | 설명 | 종류(예시) |
Expand Down
30 changes: 15 additions & 15 deletions src/components/chart/plugins/plugins.tooltip.js
Original file line number Diff line number Diff line change
Expand Up @@ -747,30 +747,30 @@ const modules = {
};
const mouseXIp = 1; // mouseInterpolation
const mouseYIp = 10;
const options = this.options;

if (offsetX >= (graphPos.x1 - mouseXIp) && offsetX <= (graphPos.x2 + mouseXIp)
&& offsetY >= (graphPos.y1 - mouseYIp) && offsetY <= (graphPos.y2 + mouseYIp)) {
if (this.options.horizontal) {
ctx.beginPath();
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1;
ctx.beginPath();
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1;

if (options.indicator?.segments) {
ctx.setLineDash(options.indicator.segments);
}

if (options.horizontal) {
ctx.moveTo(graphPos.x1, offsetY + 0.5);
ctx.lineTo(graphPos.x2, offsetY + 0.5);
ctx.stroke();
ctx.restore();
ctx.closePath();
} else {
ctx.beginPath();
ctx.save();
ctx.strokeStyle = color;
ctx.lineWidth = 1;
ctx.moveTo(offsetX + 0.5, graphPos.y1);
ctx.lineTo(offsetX + 0.5, graphPos.y2);
ctx.stroke();
ctx.restore();
ctx.closePath();
}

ctx.stroke();
ctx.restore();
ctx.closePath();
}
},

Expand Down
1 change: 1 addition & 0 deletions src/components/chart/uses.js
Original file line number Diff line number Diff line change
Expand Up @@ -115,6 +115,7 @@ const DEFAULT_OPTIONS = {
indicator: {
use: true,
color: '#EE7F44',
segments: null,
},
maxTip: {
use: false,
Expand Down