an class="token keyword">const</span> midY <span class="token operator">=</span> y<span class="token punctuation">.</span><span class="token function">getPixelForValue</span><span class="token punctuation">(</span><span class="token number">0</span><span class="token punctuation">)</span><span class="token punctuation">;</span>
    ctx<span class="token punctuation">.</span><span class="token function">save</span><span class="token punctuation">(</span><span class="token punctuation">)</span><span class="to