Tick Labels on XYPlot getting truncated

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
tmaz
Posts: 2
Joined: Thu Sep 07, 2017 3:28 am
antibot: No, of course not.

Tick Labels on XYPlot getting truncated

Post by tmaz » Thu Sep 07, 2017 3:35 am

Hello -
I am using Jfreechart's XYPlot and notice that often the tick mark labels spill over the end.. is there anyway to prevent this (ie add some sort of border)?

see screenshot https://ibb.co/gJQm6v. Notice the number 10 in both axes.

I've tried calling difference combinations of
setLowerMargin and setUpperMargin() on both the range and domain axes, but it doesn't seem to make a difference.

Thanks in advance.

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Re: Tick Labels on XYPlot getting truncated

Post by david.gilbert » Mon Oct 02, 2017 4:51 am

If you want to add a fixed amount of white space around the edges of the plot, you can use the setInsets(..) method in the Plot class:

http://www.jfree.org/jfreechart/api/jav ... gleInsets-
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

tmaz
Posts: 2
Joined: Thu Sep 07, 2017 3:28 am
antibot: No, of course not.

Re: Tick Labels on XYPlot getting truncated

Post by tmaz » Mon Oct 02, 2017 4:48 pm

thanks david.. that worked.
tom.

Locked