What's a good way to make the axis ranges a bit bigger than the data? #411
-
I'm using an Or even missing completely: I can think of some ways to manually have my chart track axis bounds and then set them, but there must be a better way. Also, I tried doing a version of that with |
Beta Was this translation helpful? Give feedback.
Replies: 1 comment 2 replies
-
Hey, 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 could be a workaround there. Last but not least you could always override the axis with your own custom implementation to get the maximum amount of control over the displayed range and which tick-marks are generated, but that might be a little bit overkill for your situation. I hope this helps, please let us know how it works out for you, Alex |
Beta Was this translation helpful? Give feedback.
Hey,
DefaultNumericAxis
(the default axis implementation) providessetAutoRangePadding(double)
to which you can e.g. provide0.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 …