Home › forums › Chart Support › CanvasJS YAxis Interval Algorithm Help
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.
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.
Thanks for the response! How do I set this for logarithmic scales?
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?
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.
You must be logged in to reply to this topic.