JFreeChart on Linux (Pie3DPlot.PERCENT_LABELS)

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
subhani
Posts: 11
Joined: Thu Mar 18, 2004 2:23 pm
Location: Hyderabad
Contact:

JFreeChart on Linux (Pie3DPlot.PERCENT_LABELS)

Post by subhani » Wed Apr 07, 2004 8:40 am

Hi,

plot.setSectionLabelType(Pie3DPlot.PERCENT_LABELS); is working on windows os, same thing is not working on Linux....
Can anybody tell me whe it's not working on Linux..

Thanx
Subhani

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 Apr 07, 2004 4:42 pm

Are you sure you are running the same version of JFreeChart on both platforms? In 0.9.17 the way labels are generated on the pie charts changed, so maybe you are running 0.9.17 on Linux.
David Gilbert
JFreeChart Project Leader

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

subhani
Posts: 11
Joined: Thu Mar 18, 2004 2:23 pm
Location: Hyderabad
Contact:

JFreeChart on Linux

Post by subhani » Thu Apr 08, 2004 5:32 am

Yes , Same versions of JFreeChart - 0.9.16 is running on both platforms.
But I am not getting it on Linux.

subhani
Posts: 11
Joined: Thu Mar 18, 2004 2:23 pm
Location: Hyderabad
Contact:

JFreeChart on Linux

Post by subhani » Thu Apr 08, 2004 6:04 am

Hi Dave Gilbert,

I' ve installed linux version of JFreeChart - 0.9.16 on Linux and windows version of JFreeChart - 0.9.16 on windows. And also we purchased developer's guide from you. In developer's guide I found the syntax for labling : plot.setSectionLabelType(Pie3DPlot.PERCENT_LABELS);

I think Linux version of JFreeChart is different from windows version, even is has same version names.

Can you please provide the solution for it....

Thank you & regards
Subahni

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 » Thu Apr 08, 2004 2:12 pm

The two archives (jfreechart-0.9.17.zip and jfreechart-0.9.17.tar.gz) are built from the *same* source code, I promise. The script that is used to build the archives is included in the distribution (ant/build.xml) if you want to see how it works.

So, to figure out your problem you will need to explain in more precise detail what is going wrong on Linux. Are you seeing any error messages?
David Gilbert
JFreeChart Project Leader

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

subhani
Posts: 11
Joined: Thu Mar 18, 2004 2:23 pm
Location: Hyderabad
Contact:

Post by subhani » Fri Apr 09, 2004 5:15 am

Its giving following error:


Generated servlet error:
[javac] Compiling 1 source file
[javac] /home/jboss-3.2.3/server/default/work/MainEngine/localhost/JFreeChartNew/mypie_chart_jsp.java:113: cannot resolve symbol
[javac] symbol : variable PERCENT_LABELS
[javac] location: class org.jfree.chart.plot.PiePlot
[javac] plot.setSectionLabelType(PiePlot.PERCENT_LABELS);
[javac] ^
[javac] 1 error






Can you please provide the solution for it....


And also, I have tested with following code to check variable PERCENT_LABELS is exist or not in PiePlot object. That variable is there in PiePlot object...



Pie3DPlot plot = (Pie3DPlot) chart.getPlot();

java.lang.reflect.Field[] f = plot.getClass().getSuperclass().getDeclaredFields();
for(int i=0;i<f.length;i++){
System.out.println("declared fields in PiePlot object "+f.toString());
}


Thank you & regards
Subhani

garv
Posts: 127
Joined: Wed Mar 31, 2004 3:44 pm
Location: Amsterdam, The Netherlands

Post by garv » Fri Apr 09, 2004 8:42 am

Hi Subhani,

I just checked this on the two versions of JFC that I happen to have around. Plot.PERCENT_LABELS exists in JFC 0.9.15, but it has been removed in JFC 0.9.17.

You have to change your mypie_chart JSP page. You need to make it use org.jfree.chart.labels.StandardPieItemLabelGenerator, with a format string.

In the format string:
{0} is the key of the data item,
{1} is the value,
{2} is the percentage.

So you could use "{0} - {2}" for example, as a formatstring.

HTH

subhani
Posts: 11
Joined: Thu Mar 18, 2004 2:23 pm
Location: Hyderabad
Contact:

Post by subhani » Mon Apr 12, 2004 10:42 am

Hi
I am using 0.9.16 only..
Please tell me solution for above query..

Regards,
Subhani

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 » Tue Apr 13, 2004 4:37 pm

David Gilbert
JFreeChart Project Leader

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

Guest

Post by Guest » Wed Apr 14, 2004 5:19 am

I' ve removed all third party tools, only JFreeChart is there.

Thank you
Subhani

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 Apr 14, 2004 11:13 am

There is some problem in your environment, but I do not know what it is.
David Gilbert
JFreeChart Project Leader

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

TheHaas
Posts: 21
Joined: Sat Feb 07, 2004 9:14 pm
Contact:

Post by TheHaas » Wed Apr 14, 2004 7:49 pm

Subhani,

Make sure you only have one JFreeChart jar in you classpath. Look in your ear's, war's, and in your lib directory under your server config. This type of thing has caused me all kinds of headaches.

Locked