positioner (tooltip properties)
툴팁의 위치를 직접 계산하는 함수를 설정합니다.
함수는 툴팁 너비(labelWidth), 높이(labelHeight), 포인트 위치(point.plotX, point.plotY)를 인자로 받고, 차트 기준 좌표 {x, y}를 반환합니다.
Info
| name |
type |
required(default) |
description |
| positioner |
function |
선택(undefined) |
툴팁의 위치를 직접 계산하는 함수를 설정합니다. |
| labelWidth |
number |
선택 |
툴팁 너비 (인자) |
| labelHeight |
number |
선택 |
툴팁 높이 (인자) |
| point.plotX |
number |
선택 |
포인트의 x 위치, 그래프 영역 기준 (인자) |
| point.plotY |
number |
선택 |
포인트의 y 위치, 그래프 영역 기준 (인자) |
Example
myChart.setOptions({
chart: {
type: "line"
},
tooltip: {
positioner: function (labelWidth, labelHeight, point) {
return { x: 10, y: 10 };
}
},
series: [{
name: "서울",
data: [60, 40, 20, 80]
}, {
name: "인천",
data: [30, 50, 90, 70]
}]
}, {
append: true,
redraw: true
});
제공 버전