How to Reference Bar Data In Custom Drawing Tool

I plan to create a custom Volume Profile drawing tool. However, after checking the drawing tool interface, I can’t find a way to reference bar data (price and volume profiles) between anchors. And I didn’t find any example on that.

Anyone knows how to do that? Or where can I find the source code of the existing volume profile drawing tool?

Thank you!

I completed a workaround solution creating a custom indicator. But I need to input the bar index manually instead of dragging the anchors like drawing tool.

How did you do the bar data?