You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I copied the example from http://bl.ocks.org/andredumas/edf630690c10b89be390
It seems the first candlestick is always cut in half. It only happens when zoom is used. Without zoom functionality, it works fine. The example is cut in half as well, but it is too small to see clearly. In my example, it is much clearer:
You see the first red bar is only half the size.
Can that be fixed?
Thanks.
The text was updated successfully, but these errors were encountered:
What you're observing is currently by design. If you print out the zoomable state on that plot you will see the right extent is not a whole number, where the left extent is.
All techanjs plots consider the midpoint of the plot object (such as candlestick) as the mapped x point on the range. So setting zoomable extent to an integer as is done in that example will cut the candle in half. This was a key decision in the early days of the library and has simplified other calculations and render logic. In order to get a full candle you could zoom an additional half index point:
// Cuts candle in halfzoomable.domain([indicatorPreRoll,data.length]);// Starts the plot between candles, getting a first full candlezoomable.domain([indicatorPreRoll-0.5,data.length]);
Note that on first initialise of the domain, the viewable domain is widened via the financescale.outerPadding variable. When setting a zoom extent, this is no longer applicable as the zoom takes over.
I copied the example from http://bl.ocks.org/andredumas/edf630690c10b89be390
It seems the first candlestick is always cut in half. It only happens when zoom is used. Without zoom functionality, it works fine. The example is cut in half as well, but it is too small to see clearly. In my example, it is much clearer:
You see the first red bar is only half the size.
Can that be fixed?
Thanks.
The text was updated successfully, but these errors were encountered: