(scale, labelSizes, padding)
| 174 | } |
| 175 | |
| 176 | function buildPointLabelItems(scale, labelSizes, padding) { |
| 177 | const items = []; |
| 178 | const valueCount = scale._pointLabels.length; |
| 179 | const opts = scale.options; |
| 180 | const {centerPointLabels, display} = opts.pointLabels; |
| 181 | const itemOpts = { |
| 182 | extra: getTickBackdropHeight(opts) / 2, |
| 183 | additionalAngle: centerPointLabels ? PI / valueCount : 0 |
| 184 | }; |
| 185 | let area; |
| 186 | |
| 187 | for (let i = 0; i < valueCount; i++) { |
| 188 | itemOpts.padding = padding[i]; |
| 189 | itemOpts.size = labelSizes[i]; |
| 190 | |
| 191 | const item = createPointLabelItem(scale, i, itemOpts); |
| 192 | items.push(item); |
| 193 | if (display === 'auto') { |
| 194 | item.visible = isNotOverlapped(item, area); |
| 195 | if (item.visible) { |
| 196 | area = item; |
| 197 | } |
| 198 | } |
| 199 | } |
| 200 | return items; |
| 201 | } |
| 202 | |
| 203 | function getTextAlignForAngle(angle) { |
| 204 | if (angle === 0 || angle === 180) { |
no test coverage detected