Hi Folks,
here is my problem:
I have a Bar Chart Diagramm which has Date Values on the X-Axis. The Format is in 'DD.MM.YYYY'
Now i've got the problem that the dates are written horizontal. So i can only show few values.
But i want to show more values.
So i need to switch the Dates to vertical.
Is there any method to do this?
Hope you can help me!
Thanks!!
How to get the X-Axis labels vertical instead of horizontal
domainAxis.setVerticalTickLabels(true)
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box. my js site
Hi Roy,
Thank You for your quick answer!
But unfortunately it doesn't work. Maybe i've done something wrong?
Here my Code:
Is there any misstake?
Thank You for your quick answer!
But unfortunately it doesn't work. Maybe i've done something wrong?
Here my Code:
Code: Select all
CategoryPlot catPlot = chart.getCategoryPlot();
CategoryAxis domainAxis = catPlot.getDomainAxis();
domainAxis.setVerticalTickLabels(true);
Bowser wrote: I have a Bar Chart Diagramm which has Date Values on the X-Axis. The Format is in 'DD.MM.YYYY'
Usually I display dates with a DateAxis so I am confused. Maybe you should post more code. Maybe a complete example.Bowser wrote: Here my Code:Code: Select all
CategoryAxis domainAxis = catPlot.getDomainAxis();
The answer does not come from thinking outside the box, rather the answer comes from realizing the truth; There is no Box. my js site
-
- Posts: 6
- Joined: Thu Jul 17, 2008 3:57 pm
- Location: Salt Lake City, Utah
This is how I do it.
Normally I use UP_45, but the 90 should get you vertical. Also you can use either up or down to change the direction of the text.
Code: Select all
JFreeChart chart = .....;
CategoryAxis axis = chart.getCategoryPlot().getDomainAxis();
axis.setCategoryLabelPositions(CategoryLabelPositions.UP_90);
Travis