pie - styles

3Overview

PIE 의 전반적인 스타일에 대한 값을 정의

stylesMidnighttruejs
var defaultStyles = {
	layout : {
		position : {
			x : 0,
			y : 0
		},
		area : {
			color : '#f8f8f8'
		},
		line : {
			color : '#eaeaea',
			width : 1
		}
	},
	pie : {
		radius : 70,
		area : {
			color : [
				'#28a9a5', '#3db4af', '#5bc4c0', '#82d2cf', 
				'#ace1df', '#c8ebea', '#d9f1f0'
			]
		},
		line : {
			color : '#fff',
			width : 3
		},
		animate : {
			use : true,
			step : 80,
			type : 'easeInOutExpo' /* linear | easeInOutExpo | none */
		},
		hover : {
			use : true,
			area : {
				color : '#138b87'
			}
		}
	},
	base : {
		use : false,
		radius : 80,
		area : {
			color : '#fff'
		},
		line : {
			color : '#fff',
			width : 1
		}
	},
	donut : {
		use : false,
		radius : 30,
		area : {
			color : '#fff'
		},
		line : {	
			color : '#fff',
			width : 1
		}
	},   
	legend : {
		use : true,
		stackedGap : 5,
		type : 'brokenLine',
		text: {
			family: 'Nanum Gothic',
			size: 12, 
			color: '#333333', 
			style: 'normal',    /* normal | italic */
			weight: 'bold',   /* normal | bold */
			opacity: 1
		},          
		pin : {
			color : '#8397a6',
			width : 1,
			length : 20,
			opacity : 1
		},
		pinHead : {
			color : '#8397a6',
			length : 20,
			width : 1,
			opacity : 1
		}            
	}
};

Configuration Styles

layout

Pie 의 레이아웃 스타일

Parameters

   defaulttype설명
layoutpositionx0numberpie 의 X 축 위치, SVG Element 의 중앙 ( 0 ) 을 기준으로 좌, 우 위치 값
 y0numberpie 의 Y 축 위치, SVG Element 의 중앙 ( 0 ) 을 기준으로 상, 하 위치 값
areacolor'#f8f8f8'stringSVG 전체 영역의 배경 색상
linecolor'#eaeaea'stringSVG 전체 영역의 테두리 색상
width1numberSVG 전체 영역의 테두리 두께

Usage

layout.positionMidnighttruejs
var styles = {
	layout: {
		position: {
			x : 50,
			y : 50	
		},
		area : {
			color : '#f8f8f8'
		},
		line : {
			color : '#eaeaea',
			width : 1
		}
	}
}

Demo

Publisher Go 

pie

pie.radius

Pie 의 반지름 값 설정

parameters

  defaulttype설명
pieradius70number

SVG element 의 높이와 넓이 중 작은 값을 기준으로 한 퍼센트 값으로 파이의 지름에 적용 된다.( 0 ~ )

  • pie.radius 가 70 일때, SVG element 의 넓이가 200px 이고 높이가 100px 이라면 파이의 지름은 100px 의 70% 인 70px 이 적용된다.

Usage

pie.radiusMidnighttruejs
var styles = {
	pie: {
		radius: 70
	}
}

Demo

Publisher Go

pie.area

Pie 의 area 영역에 대한 스타일 정의

parameters

   defaulttype설명
pieareacolor

['#28a9a5', '#3db4af', '#5bc4c0', '#82d2cf',

'#ace1df', '#c8ebea', '#d9f1f0']

arrayPIE 의 면의 색상 ( 단색 일 경우, 영문컬러명이나 RGB값 입력 )

Usage

area.colorMidnighttruejs
var styles = {
	pie: {
		area: {
			color : [
				'blue', 'purple', 'green', 'black', 'gray', 
				 'silver', 'yellow', 'navy', 'red', 'gold'
			]	
		}
	}
}

Demo

Publisher Go

parameters

   valuetype설명
pieareacolor
[ {src : 'pattern1.png'},
  {src : 'pattern2.png'},
  {src : 'pattern3.png'},
  {src : 'pattern4.png'} ]
arrayPIE 의 면의 색상 ( pattern 이미지를 사용 할 경우 )

Usage

area.patternMidnighttruejs
var styles = {
	pie: {
		area: {
			color : [
				{src : 'pattern1.png'},
				{src : 'pattern2.png'},
				{src : 'pattern3.png'},
				{src : 'pattern4.png'}
			]
		}
	}
}

Demo

Publisher Go

pie.line

Pie 의 line 에 대한 스타일 정의

  defaulttype설명
linecolor'#fff'stringPIE 의 선 색상 (영문컬러명이나 RGB값 입력)
width3stringPIE 의 선 두께 (0 ~ )

Usage

pie.lineMidnighttruejs
var styles = {
	pie: {
		line: {
			color : '#ff0000',
			width : 2
		}
	}
}

Demo

Publisher Go

pie.animate

 Pie 의 애니메이션 스타일

parameters

   defaulttype설명
pieanimateusetruebooleanPIE 의 애니메이션 사용 여부 ( 'true' or 'false' )
  step80numberPIE 의 애니메이션 속도 ( 숫자가 작을수록 애니메이션 진행 속도가 빠름 )
  type'easeInOutExpo'stringPIE 의 애니메이션 타입 ( 'linear' or 'easeInOutExpo' )

Usage

pie.animateMidnighttruejs
var styles = {
	pie: {
		animate: {
			use : true,				/* 애니메이션 사용 여부 */
			step : 80,				/* 애니메이션 속도 */
			type : 'easeInOutExpo'	/* 애니메이션 type */
		}
	}
}

Demo

Publisher Go

pie.hover

pie hover 이벤트

parameters

    defaulttype설명
piehoveruse truebooleanPIE mouse over 시 Hover 이벤트 사용 여부 ( 'true' or 'false' )
areacolor'#138b87'stringmouse over 시 PIE 의 해당 영역 색상 (영문컬러명이나 RGB값 입력)

Usage

pie.hoverMidnighttruejs
var styles = {
	pie: {
		hover: {
			use : true,				/* hover 사용 유무 [true or false] */
			area : {
				color : '#ff0000'	/* hover 사용시 area color 변경 */
			}
		}
	}
}

Demo

Publisher Go

base

pie 를 둘러싸는 원형 모양의 base 스타일

parameters

   defaulttype설명
baseuse 'false'booleanBase 사용 여부 ( 'true' or 'false' )
radius 80number

SVG element 의 높이와 넓이 중 작은 값을 기준으로 한 퍼센트 값으로 베이스의 지름에 적용 된다. ( 0 ~ )

  • base.radius 가 80 일때, SVG element 의 넓이가 200px 이고 높이가 100px 이라면 파이의 지름은 100px 의 80% 인 80px 이 적용된다.
areacolor'#fff'stringBase 영역의 색상 ( 영문컬러명이나 RGB값 입력 )
linecolor'#fff'stringBase 의 선 색상 ( 영문컬러명이나 RGB값 입력 )
width1numberBase 의 선 두께 ( 0 ~ )

Usage

baseMidnighttruejs
var styles = {
	base: {
		use : true,				/* base 사용 유무 [true or false] */
		radius : 15,
		area : {
			color : '#ff0000'
		},
		line : {
			color : '#fff',
			width : 1
		}
	}
}


Demo

Publisher Go

donut

Donut 형태의 PIE 설정

parameters

   defaulttype설명
donutuse 'false'booleanDonut 사용 여부 ( 'true' or 'false' )
radius 30number

SVG element 의 높이와 넓이 중 작은 값을 기준으로 한 퍼센트 값으로 도넛의 지름에 적용 된다. ( 0 ~ )

  • donut.radius 가 30 일때, SVG element 의 넓이가 200px 이고 높이가 100px 이라면 파이의 지름은 100px 의 30% 인 30px 이 적용된다.
areacolor'#fff'stringDonut 영역의 색상 ( 영문컬러명이나 RGB값 입력 )
linecolor'#fff'stringDonut 의 선 색상 ( 영문컬러명이나 RGB값 입력 )
width1numberDonut 의 선 두께 ( 0 ~ )

Usage

donutMidnighttruejs
var styles = {
	donut: {
		use : true,				/* donut사용 유무 [true or false] */
		radius : 30,
		area : {
			color : '#fff'
		},
		line : {
			color : '#fff',
			width : 1
		}
	}
}


Demo

Publisher Go

legend

PIE 의 legend styles

legend.use

legend 사용 여부

parameters

  defaulttype설명
legendusetruebooleanPIE 의 legend 사용 여부 ( 'true' or 'false' )

Usage

legend.useMidnighttruejs
var styles = {
	legend: {
		use : true				/* legend 사용 유무 [true or false] */
	}
}


Demo

Publisher Go

legend.stackedGap

pie 의 legend 들이 서로 겹칠 경우 겹치지 않도록 설정

parameters

  defaulttype설명
legendstackedGap5numberPie 의 Legend 가 겹칠 경우 겹친 부분의 간격을 지정한 간격 만큼 넓히도록 설정

Usage

legend.stackedGapMidnighttruejs
var styles = {
	legend: {
		stackedGap : 7
	}
}

Demo

Publisher Go

legend.type

legend 의 타입 ('brokenLine' or 'lollipop' or 'insideLegend')

  defaulttype설명
legendtype'brokenLine'stringlegend 의 타입

Usage

legend.typeMidnighttruejs
var styles = {
	legend: {
		type : 'brokenLine'			/* ['brokenLine' or 'lollipop' or 'insideLegend'] */
	}
}

legend.text

legend 의 text 영역

parameters

   defaulttype설명
legendtextfamily'Nanum Gothic'string글꼴 종류 이름 ( 영문명 )
size12number글꼴 크기 ( px 단위 )
color'#333333'string글꼴 색상 ( 영문 색상명 혹은 RGB값 )
style'normal'string글꼴 모양 ( 'normal' or 'italic')
weight'bold'string글꼴 두께 ( 'normal' or 'bold' )
opacity1number글꼴 투명도 ( 0 ~ 1 )

Usage

legend.textMidnighttruejs
var styles = {
	legend: {
		text : {
			family : 'dotum',
			size : 11, 
			color : '#000',
			style : 'normal',		/* [ normal or italic ] */
			weight : 'normal',		/* [ normal or bold ] */
			opacity : 1
		}
	}
}

Demo

Publisher Go

legend.pin

pie 와 legend 사이의 연결 선

parameters

   defaulttype설명
legendpincolor'#8397a6'stringPIE Legend 의 기본 pin 의 선 색상 ( 영문 색상명 혹은 RGB값 )
width1numberPIE Legend 의 기본 pin 의 선 두께 ( 0 ~ )
length20numberPIE Legend 의 기본 pin 길이 ( 0 ~ )
opacity1numberPIE Legend 의 기본 pin 의 선 투명도 ( 0 ~ 1 )

Usage

legend.pinMidnighttruejs
var styles = {
	legend: {
		pin : {
			color : '#8397a6',
			width : 1,
			length : 20,
			opacity : 1
		}
	}
}

Demo

Publisher Go

legend.pinHead = 'brokenLine'

legend.tip.pin 의 확장으로 꺽은 선 형태의 pinHead 스타일

   defaulttype설명
legendpinHeadcolor'#8397a6'stringbrokenLine 의 pinHead 색상 ( 영문 색상명 혹은 RGB값 )
  width1numberbrokenLine 의 pinHead 두께 ( 0 ~ )
  length20numberbrokenLine 의 pinHead 길이 ( 0 ~ )
  opacity1numberbrokenLine 의 pinHead 의 선 투명도 ( 0 ~ 1 )

Usage

legend.pinHeadMidnighttruejs
var styles = {
	legend: {
		pinHead : {				
			color : '#fff',			
			width : 1,
			length : 20,			/* tip.pinHead 길이 */
			opacity : 1
		}
	}
}

Demo

Publisher Go

legend.pinHead = 'lollipop'

legend.tip.pin 의 확장으로 막대 사탕 형태의 pinHead 스타일

parameters

    valuetype설명
legendpinHeadsize 4numberlollpop 의 크기 ( 0 ~ )
  areacolor'#8397a6'stringlollpop 영역의 색상 ( 영문 색상명 혹은 RGB값 )
  linecolor'#8397a6'stringlollpop 의 선 색상 ( 영문 색상명 혹은 RGB값 )
   width1numberlollpop 의 선 두께 ( 0 ~ )

Usage

legend.pinHeadMidnighttruejs
var styles = {
	legend: {		
		pinHead : {				
			size : 4,				/* size */
			area : {
				color : '#fff'
			},
			line : {
				color : '#455763',
				width : 4
			}
		}
	}
}

Demo

Publisher Go