Skip to content

How to detect when a "yAdjusted" label is out of bounds #964

Closed Answered by stockiNail
gterras asked this question in Q&A
Discussion options

You must be logged in to vote

@gterras apologize for my late reply but I was quite busy today on other stuff.

Here my result:

Codepen: https://codepen.io/stockinail/pen/jENgmxj

Some notes:

  • I don't use your plugin but I added other plugin with only afterDataLimits hook to set the adjust max value to the scale.
  • I use yAdjust option as scriptable options

The sample is based on the use case you shared but it should have any hard code conf (I set 5 ad padding between labels and between the stack bar and the first label but you can use whatever you want).

Feel free to play with codepen and let me know if make sense to you.

Replies: 2 comments 11 replies

Comment options

You must be logged in to vote
10 replies
@gterras
Comment options

@stockiNail
Comment options

@gterras
Comment options

@stockiNail
Comment options

Answer selected by gterras
@gterras
Comment options

Comment options

You must be logged in to vote
1 reply
@stockiNail
Comment options

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
2 participants