Skip to content

What's a good way to make the axis ranges a bit bigger than the data? #411

Answered by wirew0rm
domenicquirl asked this question in Q&A
Discussion options

You must be logged in to vote

Hey, DefaultNumericAxis(the default axis implementation) provides setAutoRangePadding(double) to which you can e.g. provide 0.1 to add a padding of 10% of the data range to the lower and upper bound of the axis. I'm not sure if it will resolve the incomplete axis labels, as the labels will probably be computed for the range after applying the padding, but it will move the data inwards where there are complete labels.

I believe the labels being cut off is probably a bug. If I remember correctly the canvas for horizontal axes is wider than the plot canvas, to allow the labels to be rendered completely and fit below the vertical axes. Maybe adding a blank axis to the right side of the chart …

Replies: 1 comment 2 replies

Comment options

You must be logged in to vote
2 replies
@domenicquirl
Comment options

@wirew0rm
Comment options

Answer selected by domenicquirl
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