LollipopSeries extends BasedSeries
Lollipop(막대 사탕) 시리즈 모델.
type은 'lollipop'이고,
설정 모델은 LollipopSeriesOptions이다.
Properties
canPolar: boolean (opens in a new tab) readonly
polar가 적용 가능한 시리즈 인지.
default :undefined
col: number (opens in a new tab) readonly
col
default :undefined
data: any (opens in a new tab) readonly
데이터포인터들을 생성하는 데 사용되는 값 목록.
default :undefined
index: number (opens in a new tab) readonly
차트나 시리즈그룹 내에서 위치.
default :undefined
name: string (opens in a new tab) readonly
시리즈 이름.
시리즈 생성시 지정된 후 변경할 수 없다.
차트의 다른 구성 요소에서 이 시리즈를 참조할 때 사용되며,
레전드나 툴팁에서 시리즈를 나타내는 텍스트로도 사용된다.
default :undefined
options: LollipopSeriesOptions readonly
차트를 생성할 때나 updateOptions 등을 통해 이 모델 객체에 설정된 옵션 값들과
기본 설정값들이 포함된 원본 설정 객체(복사본이 아니다).
리턴된 객체의 속성값들을 가져올 수 있지만,
속성들을 직접 수정하는 것은 권장되는 방법이 아니다.
updateOptions나 updateOption 등을 사용해서 옵션들을 변경해야 한다.
default :undefined
pointCount: number (opens in a new tab) readonly
시리즈에 설정된 데이터포인트 개수.
default :undefined
pointLabel: DataPointLabel readonly
데이터포인트 label 설정 모델.
default :undefined
row: number (opens in a new tab) readonly
row
default :undefined
trendline: Trendline readonly
추세선 설정 모델.
default :undefined
visible: boolean (opens in a new tab) readonly
표시 여부.
설정 옵션의 visible 값을 그대로 return하는 것이 아니라,
undefined나 null 등으로 지정하는 경우 모델의 상태에 따라 true나 false로 해석될 수 있다.
설정의 경우 updateOption으로 지정하는 것과 동일하다.
model.updateOption('visible', value);model.updateOptions({
visible: value
});default :undefined
visiblePointCount: number (opens in a new tab) readonly
시리즈에 설정된 데이터포인트들 중 표시 중인 것들의 개수.
default :undefined
visiblePoints: Array (opens in a new tab)<DataPoint> readonly
시리즈에 설정된 데이터포인트들 중 표시 중인 것들의 목록.
default :undefined
Methods
addPoint(source): DataPoint
데이터포인트를 추가한다.
| Parameter | Type | Description |
|---|---|---|
| source | any (opens in a new tab) | 데이터포인트 원본 정보. |
return 실제 추가된 데이터포인트 객체.
addPoints(source): Array (opens in a new tab)<DataPoint>
하나 이상의 데이터포인트들을 추가한다.
| Parameter | Type | Description |
|---|---|---|
| source | Array (opens in a new tab)<any (opens in a new tab)> | 데이터포인트 원본 목록. |
return 실제 추가된 데이터포인트 객체 배열.
clearOptions(render?): LollipopSeries
updateOptions나 updateOption 등을 통해 설정된 모든 옵션 값들을 제거하거나,
전역 기본값이 존재하는 경우 그 값으로 되돌린다.
| Parameter | Type | Description |
|---|---|---|
render=true | boolean (opens in a new tab) | true(기본값)으로 지정하면 차트를 다시 그린다. |
return 객체 자신.
destroy(): null
객체가 소유한 참조 등을 해제하고 null을 리턴한다.
model = model.destroy();return null
getPointAt(xValue): DataPoint
지정한 x축 값에 위치한 첫번째 데이터포인트를 리턴한다.
전달되는 데이터포인트 정보는 리턴 시점의 복사본이다.
| Parameter | Type | Description |
|---|---|---|
| xValue | any (opens in a new tab) | x값. |
return 데이터포인트 객체.
getPointsByRange(from, to): Array (opens in a new tab)<DataPoint>
지정한 x축 범위 내에 있는 데이터포인트들을 리턴한다.
| Parameter | Type |
|---|---|
| from | number (opens in a new tab) |
| to | number (opens in a new tab) |
getValueAt(xValue, prop?): number (opens in a new tab)
xValue에 해당하는 첫번째 데이터포인터의 yValue를 리턴한다.
| Parameter | Type | Description |
|---|---|---|
| xValue | any (opens in a new tab) | x값 혹은 x,y값이 포함된 데이터포인트 정보. x축이 category 축이면 카테고리 이름을 지정할 수 있다. |
prop='yValue' | string (opens in a new tab) | 가져올 값. 지정하지 않으면 'yValue'. |
return prop로 지정한 데이터포인트 값.
getVisiblePoint(index): DataPoint
시리즈에 설정된 데이터포인트들 중 표시 중인 index번째 포인트 객체.
| Parameter | Type |
|---|---|
| index | number (opens in a new tab) |
loadOptions(source): LollipopSeries
기존 옵션 값들을 모두 제거하고 source에 지정한 값들로 새로 구성한다.
chart.legend.loadOptions({
visible: true,
location: 'right
})| Parameter | Type | Description |
|---|---|---|
| source | LollipopSeriesOptions | 설정 정보 객체 혹은 단일값. |
return 이 객체 자신.
removeOption(prop, render?): LollipopSeries
지정한 속성에 설정한 값이 있으면 제거하고, 기본값으로(있다면) 되돌린다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) LollipopSeriesOptions | 속성 이름. |
render=true | boolean (opens in a new tab) | true(기본값)으로 지정하면 차트를 다시 그린다. |
return 객체 자신.
removePoint(p): boolean (opens in a new tab)
데이터포인트를 제거한다.
p 매개변수에 데이터포인트 대신 값을 지정하면,
그 값이 xValue와 동일한 첫번째 데이터포인트를 찾는다.
| Parameter | Type | Description |
|---|---|---|
| p | string (opens in a new tab) | number (opens in a new tab) | DataPoint | 제거할 데이터포인트 객체. |
return 실제로 제거되면 true를 리턴한다.
removePoints(pts): number (opens in a new tab)
지정한 데이터포인트들를 제거한다.
pts 매개변수에 데이터포인트 대신 값들을 지정하면,
그 값이 xValue와 동일한 첫번째 데이터포인트를 찾는다.
| Parameter | Type | Description |
|---|---|---|
| pts | Array (opens in a new tab)<string (opens in a new tab) | number (opens in a new tab) | DataPoint> | 제거할 데이터포인트 목록. |
return 실제로 제거되면 데이터포인트 개수.
saveOptions(recursive?): any (opens in a new tab)
이 모델 객체에 설정된 전역 기본값과 다른 옵션 값들이 포함된 사본 객체로 리턴한다.
options 객체에는 전역 기본값들도 포함되어 있다.
const options = chart.legend.saveOptions();
console.log(options);| Parameter | Type | Description |
|---|---|---|
recursive=true | boolean (opens in a new tab) | 기본값 true이면 하위 모델의 옵션들도 포함된다. |
return 옵션 사본 객체.
toggleOption(prop, render?): LollipopSeries
Boolean 타입의 설정값을 변경한다.
지정 가능한 설정 값 목록은 Configuration API 페이지에서 확인할 수 있다.
chart.getSeries('ser02').toggleOption('visible');| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) LollipopSeriesOptions | 설정 속성 이름. |
render=true | boolean (opens in a new tab) | true로 지정하면 chart를 다시 그린다. false로 지정하고 여러 설정 후에 render를 호출해서 다시 그리게 할 수도 있다. 기본값은 true. |
return 객체 자신.
updateData(data): void (opens in a new tab)
시리즈 data 원본을 변경하고 데이터포인트들을 다시 생성한다.
[주의] x축이 카테고리 축이고, x축의 categories 속성이 명시적으로 설정되지 않았다면,
이 함수 호출 후 카테고리가 변경될 수 있다.
| Parameter | Type | Description |
|---|---|---|
| data | any (opens in a new tab) | 원본 데이터포인트 값 배열. |
updateOption(prop, value, render?, force?): LollipopSeries
하나의 속성 값을 설정한다.
여러 속성들을 한꺼번에 변경할 때는 updateOptions를 사용한다.
기본적으로 이전 값과 다른 경우에만 적용된다.
특히, 속성값이 객체인 경우 객체 속성만 바뀐 경우 적용되지 않는다.
바꾸고 싶다면 force 매개변수를 true로 지정해서 호출한다.
또, prop 매개변수가 하위 모델 이름인 경우 하위 모델의 updateOptions를 호출한 것과 동일하다.
| Parameter | Type | Description |
|---|---|---|
| prop | keyof (opens in a new tab) LollipopSeriesOptions | |
| value | any (opens in a new tab) | |
render=true | boolean (opens in a new tab) | true로 지정하면 설정 후 차트를 다시 그린다. |
force=false | boolean (opens in a new tab) | 지정한 값이 이전 값과 동일한 경우에도 적용한다. |
return 객체 자신.
updateOptions(source?, render?): LollipopSeries
하나 이상의 option 설정을 하고,
차트가 다시 그려지도록 한다.
chart.legend.updateOptions({
gap: 10,
lineGap: 20
});권장하는 방식은 아니지만, options의 값들을 직접 수정한 후에도 이 메소드를 호출해서
내부의 값들이 다시 계산되도록 해야 한다.
chart.legend.options.gap = 10,
chart.legend.options.lineGap = 20,
chart.legend.updateOptions();| Parameter | Type | Description |
|---|---|---|
| source | LollipopSeriesOptions | 설정 정보 객체 혹은 단일값. |
render=true | boolean (opens in a new tab) | true로 지정하면 설정 후 차트를 다시 그린다. |
return 객체 자신.
updatePoint(p, props): boolean (opens in a new tab)
데이터포인터의 값들을 변경한다.
p 매개변수에 데이터포인트 대신 값을 지정하면,
그 값이 xValue와 동일한 첫번째 데이터포인트를 찾는다.
시리즈에 data를 지정하는 것과 동일한 방식으로 데이터포인트의 값(들)을 변경할 수 있다.
[주의] json으로 필드값(들)을 지정할 때는 시리즈에 지정된 field 이름 속성들과 같은 이름으로 값들을 지정해야 한다.
const x = '신흥동';
const p = chart.series.getPointAt(x)
chart.series.updatePoint(p, v + 10);| Parameter | Type | Description |
|---|---|---|
| p | string (opens in a new tab) | number (opens in a new tab) | DataPoint | 데이터포인트 객체. |
| props | any (opens in a new tab) |
return 변경됐으면 true.