| 92 | } |
| 93 | |
| 94 | function drawLine(x1, x2, style, x, y) { |
| 95 | if (!style) return |
| 96 | |
| 97 | this.context.save() |
| 98 | this.context.strokeStyle = style.color || "black" |
| 99 | this.context.lineWidth = (style.width || 1) * this.ratio |
| 100 | this.context.globalAlpha = style.alpha || 1 |
| 101 | this.context.beginPath() |
| 102 | this.context.moveTo(style.direction != "right" ? x1 : x, y) |
| 103 | this.context.lineTo(style.direction != "left" ? x2 : x, y) |
| 104 | this.context.stroke() |
| 105 | this.context.restore() |
| 106 | } |
| 107 | |
| 108 | function showTooltip(e) { |
| 109 | var x = e.offsetX || e.layerX || 0 |