MCPcopy Create free account
hub / github.com/breck7/scroll / drawLine

Function drawLine

external/.sparkline.js:94–106  ·  view source on GitHub ↗
(x1, x2, style, x, y)

Source from the content-addressed store, hash-verified

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

Callers

nothing calls this directly

Calls 2

moveToMethod · 0.45
lineToMethod · 0.45

Tested by

no test coverage detected