[]
SpreadJS는 도형의 외형을 사용자 정의할 수 있도록 다양한 유형의 복합 선(Compound Line)을 지원합니다. 다음과 같은 유형이 제공됩니다:
복합 선 유형 | ||
---|---|---|
아래는 자동 도형 및 커넥터에 복합 선을 추가하여 아래 이미지처럼 표현하는 코드 샘플입니다.
Ask ChatGPT
function applyShapeStyle(shapeVar) {
var shapeStyle = shapeVar.style();
shapeStyle.fill.color = "pink";
shapeStyle.line.joinType = 1;
// 복합 선 유형 중 double(이중선) 추가
shapeStyle.line.compoundType = 1;
shapeStyle.line.color = "grey";
shapeStyle.line.width = 5;
shapeStyle.textFrame.vAlign = GC.Spread.Sheets.VerticalAlign.center;
shapeStyle.textFrame.hAlign = GC.Spread.Sheets.HorizontalAlign.center;
shapeVar.style(shapeStyle);
}
function applyLineStyle(lineVar) {
var style = lineVar.style();
var line = style.line;
line.width = 10;
line.color = 'pink';
line.endArrowheadStyle = GC.Spread.Sheets.Shapes.ArrowheadStyle.triangle;
// 복합 선 유형 중 thickThin(굵은-가는 선) 추가
line.compoundType = GC.Spread.Sheets.Shapes.CompoundType.thickThin;
lineVar.style(style);
}