Home forums Using CanvasJS CanvasJS YAxis Interval Algorithm Help

This topic contains 4 replies, has 2 voices, and was last updated by  Indranil Deo 8 months, 3 weeks ago.

Viewing 5 posts - 1 through 5 (of 5 total)
  • Author
    Posts
  • #19978

    tieoneease
    Member

    Hey CanvasJS team! We have a team that wants to run an experiment using CanvasJS that involves manipulating how the data is displayed. We’ve been having an issue getting our own interval algorithms to display the graph that we want, and we think CanvasJS defaults are doing a really good job. In order for us to be able to use CanvasJS in our research paper, we need to be able to describe how the Y Axis is being manipulated and displayed (a rough math formula for it). Is it possible for you guys to give me a description of what’s going on in the following scenarios:

    How the YAxis intervals are auto-calculated for a linear graph without includeZero set?
    How the YAxis intervals are auto-calculated for a logarithmic graph with a hard minimum of 1 and a range of values that go up to 1million. Sometimes we’re seeing the logarithmic graph leave out many ticks that we’d like, and we haven’t figured out how to avoid this.

    Thanks!

    #19984

    Indranil Deo
    Member

    @tieoneease,

    How the YAxis intervals are auto-calculated for a linear graph without includeZero set?
    How the YAxis intervals are auto-calculated for a logarithmic graph with a hard minimum of 1 and a range of values that go up to 1million. Sometimes we’re seeing the logarithmic graph leave out many ticks that we’d like, and we haven’t figured out how to avoid this.

    Interval depends on the range and the number of ticks that could be shown for the width of the chart. Please take a look at this jsfiddle to add number of ticks based on your requirement.

    ____________
    Indranil Deo,
    Team CanvasJS

    #19986

    tieoneease
    Member

    Thanks for the response! How do I set this for logarithmic scales?

    #19987

    tieoneease
    Member

    What if we like canvasJS’s default way of calculating the intervals? Our only requirement is that we are able to express this mathematically or in some other way so we can outline our research process in the academic paper. Is it easy to describe what is happening under the hood?

    #20011

    Indranil Deo
    Member

    @tieoneease,

    CanvasJS charts use the same algorithm as described in the previous reply to calculate intervals, i.e. Interval is dependent on range and the number of ticks to be shown within that range. You can also refer Wilkinson’s algorithms for Positioning labels and ticks for more information.

    ___________
    Indranil Deo,
    Team CanvasJS

Viewing 5 posts - 1 through 5 (of 5 total)

You must be logged in to reply to this topic.