react-stockcharts
react-stockcharts copied to clipboard
Annotations falling off chart
I'm using a modified version of BarAnnotations (react-stockcharts/src/annotation/BarAnnotation.js) but the annotations are falling off the chart canvas. Any idea on what I need to adjust so that not only the candlesticks, but also the annotations, stay on the chart?
Here's a screenshot (notice the bottom annotations are falling off the chart):
Or let me ask it this way...
How does the native code ensure the candlesticks remain visible on the screen?
Ok, I think I have my answer. The <Chart/>
object takes a parm yExtents. In many of the example it does things like: yExtents={d => [d.high, d.low]}. This defines the high and low edges for the chart on the yscale. So I would need to find a way to add some arbitrary padding OR more correctly calculate how much extra room above/below is needed if there's annotations being added.