| 44 | } |
| 45 | |
| 46 | function parsePosition(seriesModel: GaugeSeriesModel, api: ExtensionAPI): PosInfo { |
| 47 | const center = seriesModel.get('center'); |
| 48 | const width = api.getWidth(); |
| 49 | const height = api.getHeight(); |
| 50 | const size = Math.min(width, height); |
| 51 | const cx = parsePercent(center[0], api.getWidth()); |
| 52 | const cy = parsePercent(center[1], api.getHeight()); |
| 53 | const r = parsePercent(seriesModel.get('radius'), size / 2); |
| 54 | |
| 55 | return { |
| 56 | cx: cx, |
| 57 | cy: cy, |
| 58 | r: r |
| 59 | }; |
| 60 | } |
| 61 | |
| 62 | function formatLabel(value: number, labelFormatter: string | ((value: number) => string)): string { |
| 63 | let label = value == null ? '' : (value + ''); |