TimeSeries Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
axel
Posts: 21
Joined: Fri Aug 10, 2007 12:37 pm

TimeSeries Chart

Post by axel » Sat Sep 08, 2007 5:15 pm

Hi everybody !

I am trying to rotate the labels on a timeseries chart ? Is there a similar function to SetCategoryLabelPositions ?

Many thanks in advance !!

Axel

axel
Posts: 21
Joined: Fri Aug 10, 2007 12:37 pm

Post by axel » Mon Sep 17, 2007 1:18 pm

up :D :D :D

Nobody has an idea about this subject :cry:

jwenting
Posts: 157
Joined: Sat Jul 15, 2006 7:46 am

Post by jwenting » Mon Sep 17, 2007 1:52 pm

You could try setLabelAngle. It sounds hopeful but I've no idea whatsoever whether it does anything, let alone what you're trying to do.

axel
Posts: 21
Joined: Fri Aug 10, 2007 12:37 pm

Post by axel » Mon Sep 17, 2007 7:02 pm

Thanks for your answer.

Unfortunately I still have the problem :(

I found this old post
http://www.jfree.org/phpBB2/viewtopic.p ... 34df545000
I don't know it this feature was implemented in the meantime.... if somebody know, it would really help me !

axel
Posts: 21
Joined: Fri Aug 10, 2007 12:37 pm

Post by axel » Wed Sep 26, 2007 9:08 am

Anybody has an idea :( :( :(

Sorry to insist... it would really help me to solve this : I have the dates on the time axis that are superimposed, and it's impossible to read anything. I have tried to make the chart larger, but I still have the problem.

Thanks again for your help !

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

Post by david.gilbert » Wed Sep 26, 2007 11:29 am

There isn't a general rotation option available for the DateAxis (and NumberAxis), but you can call setVerticalTickLabels(true) to have the labels rotated by 90 degrees (the method is badly named, I know).

If you are getting overlapping labels on a DateAxis, this means you've specified a fixed tick size rather than letting JFreeChart choose a size automatically...perhaps you want to revert to the default behaviour?
David Gilbert
JFreeChart Project Leader

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

axel
Posts: 21
Joined: Fri Aug 10, 2007 12:37 pm

Post by axel » Thu Sep 27, 2007 9:56 pm

Thanks for yor answer David ! The setVerticalTickLabels functions very well ! It makes my chart readable now !

Concerning the overlapping lables problem, I have not specified any fixed tick size ... or at least it was not deliberate :lol:
Could you just tell me how I could revert to the default sizing behaviour ? Here is my code

Code: Select all

DateAxis timeAxis = new DateAxis("");
timeAxis.setVerticalTickLabels(true);
NumberAxis valueAxis = new NumberAxis("");
timeAxis.setTickUnit(new DateTickUnit(DateTickUnit.MONTH, 1, sdf));
(CategoryLabelPositions.UP_45);
StandardXYItemRenderer renderer = new StandardXYItemRenderer(StandardXYItemRenderer.LINES + StandardXYItemRenderer.SHAPES,ttg, urlg);
renderer.setShapesFilled(true);
XYPlot plot = new XYPlot(xyDataset, timeAxis, valueAxis, renderer);
JFreeChart chart = new JFreeChart("Réparations pour la ligne: "+section, JFreeChart.DEFAULT_TITLE_FONT, plot, false);
Once again, many thanks for your help !

Locked