Need Help Regarding Jfree Chart

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
rajibmishra1980
Posts: 1
Joined: Sat Nov 29, 2008 6:37 pm
Contact:

Need Help Regarding Jfree Chart

Post by rajibmishra1980 » Sat Nov 29, 2008 6:46 pm

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

jamesmarkchan
Posts: 2
Joined: Fri Dec 04, 2009 1:18 am
antibot: No, of course not.

Re: Need Help Regarding Jfree Chart

Post by jamesmarkchan » Fri Dec 04, 2009 7:55 pm

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).

skunk
Posts: 1087
Joined: Thu Jun 02, 2005 10:14 pm
Location: Brisbane, Australia

Re: Need Help Regarding Jfree Chart

Post by skunk » Fri Dec 04, 2009 8:57 pm

Code: Select all

public void setNumberFormatOverride(NumberFormat formatter)

jamesmarkchan
Posts: 2
Joined: Fri Dec 04, 2009 1:18 am
antibot: No, of course not.

Re: Need Help Regarding Jfree Chart

Post by jamesmarkchan » Sat Dec 05, 2009 12:42 am

i'm using this from a previous poster. Thanks for the help!!! :D

Code: Select all

final NumberAxis domainAxis = (NumberAxis)chart.getXYPlot().getDomainAxis(); 
final DecimalFormat format = new DecimalFormat("####"); 
domainAxis.setNumberFormatOverride(format);

bluesh34
Posts: 2
Joined: Tue Oct 08, 2013 4:25 pm
antibot: No, of course not.

Re: Need Help Regarding Jfree Chart

Post by bluesh34 » Fri Nov 15, 2013 4:59 pm

The above answer doesn't work: maybe some additional code is needed.

david.gilbert
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

Post by david.gilbert » Mon Nov 18, 2013 9:06 am

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

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

Locked