MCPcopy Create free account
hub / github.com/DesignRevision/shards-dashboard-react / draw

Function draw

src/utils/chart.js:5–25  ·  view source on GitHub ↗
(ease)

Source from the content-addressed store, hash-verified

3Chart.defaults.LineWithLine = Chart.defaults.line;
4Chart.controllers.LineWithLine = Chart.controllers.line.extend({
5 draw(ease) {
6 Chart.controllers.line.prototype.draw.call(this, ease);
7
8 if (this.chart.tooltip._active && this.chart.tooltip._active.length) {
9 const activePoint = this.chart.tooltip._active[0];
10 const { ctx } = this.chart;
11 const { x } = activePoint.tooltipPosition();
12 const topY = this.chart.scales['y-axis-0'].top;
13 const bottomY = this.chart.scales['y-axis-0'].bottom;
14
15 // Draw the line
16 ctx.save();
17 ctx.beginPath();
18 ctx.moveTo(x, topY);
19 ctx.lineTo(x, bottomY);
20 ctx.lineWidth = 0.5;
21 ctx.strokeStyle = '#ddd';
22 ctx.stroke();
23 ctx.restore();
24 }
25 },
26});
27
28export default Chart;

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected