Tick Labels on XYPlot getting truncated

A discussion forum for JFreeChart (a 2D chart library for the Java platform).

Tick Labels on XYPlot getting truncated

Postby 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.
tmaz
 
Posts: 2
Joined: Thu Sep 07, 2017 3:28 am

Re: Tick Labels on XYPlot getting truncated

Postby 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: Ask your company to buy the JFreeChart Developer Guide
:idea: Check out other products sold by my company Object Refinery Limited
david.gilbert
JFreeChart Project Leader
 
Posts: 11653
Joined: Fri Mar 14, 2003 10:29 am

Re: Tick Labels on XYPlot getting truncated

Postby tmaz » Mon Oct 02, 2017 4:48 pm

thanks david.. that worked.
tom.
tmaz
 
Posts: 2
Joined: Thu Sep 07, 2017 3:28 am


Return to JFreeChart

Who is online

Users browsing this forum: Bing [Bot], Yahoo [Bot] and 2 guests