(points, series, config, context)
| 1543 | } |
| 1544 | |
| 1545 | function drawPointText(points, series, config, context) { |
| 1546 | // 绘制数据文案 |
| 1547 | var data = series.data; |
| 1548 | points.forEach(function(item, index) { |
| 1549 | if (item !== null) { |
| 1550 | //var formatVal = series.format ? series.format(data[index]) : data[index]; |
| 1551 | context.beginPath(); |
| 1552 | context.setFontSize(series.textSize || config.fontSize); |
| 1553 | context.setFillStyle(series.textColor || '#666666'); |
| 1554 | var value = data[index] |
| 1555 | if (typeof data[index] === 'object' && data[index] !== null) { |
| 1556 | value = data[index].value |
| 1557 | } |
| 1558 | var formatVal = series.format ? series.format(value) : value; |
| 1559 | context.fillText(String(formatVal), item.x - measureText(formatVal, series.textSize || config.fontSize) / 2, item.y - |
| 1560 | 2); |
| 1561 | context.closePath(); |
| 1562 | context.stroke(); |
| 1563 | } |
| 1564 | }); |
| 1565 | |
| 1566 | } |
| 1567 | |
| 1568 | function drawGaugeLabel(gaugeOption, radius, centerPosition, opts, config, context) { |
| 1569 | radius -= gaugeOption.width / 2 + config.gaugeLabelTextMargin; |
no test coverage detected