Giter VIP home page Giter VIP logo

Comments (2)

andredumas avatar andredumas commented on June 16, 2024

Hi @sf-wind

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.

console.log(x.zoomable.domain());

// Output is
//  [33, 250.52]

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 half
zoomable.domain([indicatorPreRoll, data.length]); 

// Starts the plot between candles, getting a first full candle
zoomable.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.

andre

from techan.js.

andredumas avatar andredumas commented on June 16, 2024

Closing due to no activity.

from techan.js.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.