KLineChart
KLineChart copied to clipboard
[Bug] Canvas shapes not aligning
Version
8.6.0
Steps to Reproduce
To demonstrate I modified the test file https://github.com/liihuu/KLineChart/blob/master/tests/technical-indicator-template2.html
Changed the bar color to be more clear and height to full:
const realBarHeight = barHeight
ctx.globalCompositeOperation = 'source-over'
ctx.fillStyle = 'rgba(0, 155, 69, 0.8)'
Current Behavior
You can see that sometimes the bars align perfectly but most of the time they do not:
Expected Behavior
All bars should have no spaces and should not overlap each other
I am coding a Volume Profile indicator and my bars do not have even spaces like in this Tradingview vs Klinecharts bars example:
Environment
- OS: Linux
- Browser: Firefox, Chrome
- Framework:
Any additional comments?
No response
Maybe it is related to Pixel perfect rendering?
- https://www.tradingview.com/blog/en/announcing-lightweight-charts-2-0-17910/
- https://github.com/tradingview/lightweight-charts/issues/274
- https://github.com/tradingview/fancy-canvas
Yes, I will optimize the later version. Thank you.