HI,
I am new to the Jfree chart. Already Developed lot of reports for one application. But i am facing one problem. Can any one help me regarding how to move to Legend position and I want to remove the comma from y axis value. Example :
---------------------------------------------------------------------------------------------------------------
For Legend
By default Legend is coming in down of the report. But i want to move it to right side of the report.
For Comma:
In my line chart Y axis values are coming like 2,001 2,002.
So i want to remove the comma. I want to make like this 2001 2002.
---------------------------------------------------------------------------------------------------------------
Please any one give me some sample code.
I am using jfreechart-1.0.11 jar file
Please help me its very urgent
Regards
Rajib Mishra
Need Help Regarding Jfree Chart
-
- Posts: 1
- Joined: Sat Nov 29, 2008 6:37 pm
- Contact:
-
- Posts: 2
- Joined: Fri Dec 04, 2009 1:18 am
- antibot: No, of course not.
Re: Need Help Regarding Jfree Chart
I need help with removing commas also if anyone would be willing to drop some hints. I'm trying to remove the commas from the domain axis to represent wavelength in (nm).
Re: Need Help Regarding Jfree Chart
Code: Select all
public void setNumberFormatOverride(NumberFormat formatter)
-
- Posts: 2
- Joined: Fri Dec 04, 2009 1:18 am
- antibot: No, of course not.
Re: Need Help Regarding Jfree Chart
i'm using this from a previous poster. Thanks for the help!!! 

Code: Select all
final NumberAxis domainAxis = (NumberAxis)chart.getXYPlot().getDomainAxis();
final DecimalFormat format = new DecimalFormat("####");
domainAxis.setNumberFormatOverride(format);
Re: Need Help Regarding Jfree Chart
The above answer doesn't work: maybe some additional code is needed.
-
- JFreeChart Project Leader
- Posts: 11734
- Joined: Fri Mar 14, 2003 10:29 am
- antibot: No, of course not.
- Contact:
Re: Need Help Regarding Jfree Chart
It should work, although there may be some confusion because the thread mentions the y-axis (range axis in JFreeChart) whereas the code snippet sets the date formatter for the domain axis (x-axis).
David Gilbert
JFreeChart Project Leader
Read my blog
Support JFree via the Github sponsorship program
JFreeChart Project Leader

