Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Manual control of axis bounds #33

Open
iwbnwif opened this issue May 4, 2017 · 2 comments
Open

Manual control of axis bounds #33

iwbnwif opened this issue May 4, 2017 · 2 comments
Assignees
Milestone

Comments

@iwbnwif
Copy link
Owner

iwbnwif commented May 4, 2017

This issue is a place holder for the time being and I will add more detail later.

The 'nice' interval calculation is okay for some basic charting, but it is also necessary to have fine grained control over axis bounds and intervals.

Basically, I think the following is needed:

  1. Fully automatic range and interval calculation
  2. User specified range (max and min values)
  3. Automatic calculation of a 'nice' interval given a fixed range
  4. Calculation of a 'nice' interval with a user specified number of interval points for a fixed range
  5. Calculation of a 'nice' interval with a user specified number of interval points for an automatic range
  6. Manual interval setting with an automatic range
  7. Manual interval setting with fixed range
  8. Setting the number of minor ticks per interval

So it seems the first thing to do is:

  1. Calculate the range either automatically or manually
    2a. Either use the user specified manual interval or
    2b. Calculate a nice interval based on a default number of interval points or
    2c. Calculate a nice interval based on a user specified number of interval points
  2. Calculate the minor ticks either manual or using the default value.
@psychegr
Copy link

psychegr commented May 4, 2017

Should the default value for ticks create "evenly spaced ticks" regardless of their real value?

@iwbnwif
Copy link
Owner Author

iwbnwif commented May 4, 2017

Should the default value for ticks create "evenly spaced ticks" regardless of their real value?

The current strategy for number axis is to use 'nice' values as the default intervals, that means one of 1, 2, 5 and 10 or their factors (e.g. 0.1, 0.2, 0.5 and 1.0). The value is also selected to divide the range into approximately 8 intervals.

The range is then adjusted to include the interval below the lowest data point and the interval above the highest.

In my terminology, a 'major tick' is drawn at every interval and these are divided (if needed) by a fixed number of 'minor ticks'. So if the interval represents 0.5 then the minor tick count could be 5, with each minor tick representing 0.1.

I need to override this behaviour for date/time axis (not done yet).

Also, there are a couple of problems:

  1. The algorithm can generate different numbers of intervals for different axis. This causes problems on shared axis because it makes the gridlines look weird
  2. Small datasets (0 or 1 points) cause real problems!

Finally, I think that it would be useful to be able to match X and Y interval counts or perhaps pixel spacing to facilitate / ensure that the grid 'squares' are actually square. This might be very complicated though!

@iwbnwif iwbnwif self-assigned this May 18, 2017
@iwbnwif iwbnwif added this to the 2.0 milestone May 18, 2017
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants