I can’t figure out how to use plotting.x.relative properly, nor can I find any working examples of it.
Here’s an example of some code I’m using, if I comment out line 1 and uncomment line 2, everything works fine
const left = p.x.relative(history.get(rangeStart), 5);
//const left = p.x.get(history.get(rangeStart));
const right = p.x.get(history.get(rangeEnd-1));
const path = p.createPath();
path.moveTo(left, rangeHigh);
path.lineTo(left, rangeLow);
path.lineTo(right, rangeLow);
path.lineTo(right, rangeHigh);
path.lineTo(left, rangeHigh);
canvas.drawPath(
path.end(),
{
color: rangeColor,
width: 2,
opacity: 1
});
What’s a working way to use plotting.x.relative or plotting.x.between?