Solved

Jfreecharc colors

Posted on 2003-12-05
14
464 Views
Last Modified: 2007-12-19
Hi,
I am using JfreeChart to dipaly graphs on my webpage.

http://cewolf.sourceforge.net/tutorial.html
http://cewolf.sourceforge.net

I am trying to use only bold colors to display the graphs basically I do not want to use yellow and replace it with brown.

AbstractRenderer renderer = (AbstractRenderer) plot.getRenderer();
renderer.setSeriesPaint (0,Color.green);
renderer.setSeriesPaint (1,Color.red);
renderer.setSeriesPaint (2,Color.blue);
but still not able to get it work.

Has anyone had this experince before?
Thx for your help
0
Comment
Question by:applekanna
  • 5
  • 5
  • 2
  • +1
14 Comments
 
LVL 15

Expert Comment

by:jimmack
ID: 9883297
I'm not quite sure what you're asking.

Are you saying that your color changes aren't taking effect or that you need the definition of the color brown?
0
 
LVL 3

Author Comment

by:applekanna
ID: 9883306
>>Are you saying that your color changes aren't taking effect or that you need the definition of the color brown?

My colr changes are not taking effect.
Thx
0
 
LVL 3

Author Comment

by:applekanna
ID: 9883313
Also wanted o know if there was any other way to do this.
Thank you.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9883318
Can't you set the color directly in the page tag?
0
 
LVL 15

Expert Comment

by:jimmack
ID: 9883416
Can you post a bit more code?

If you're using the cewolf code, are you sure that you've replaced their color setting method with your own (eg. do you change the colors, then they change them back ;-))?
0
 
LVL 3

Author Comment

by:applekanna
ID: 9883442
okie... let me back trak a bit and make my question clear.
Asuming I use the tutorial given in cewolf alone, and do not use any renderer etc.
how do I change the color of the graph lines that are produced in tutorial ...
Thank you.

code from the tutorial modified

<cewolf:chart  id="line" title="Test Graph" type="line"  xaxislabel="Month" yaxislabel="Amount Earned"
<cewolf:data>
<cewolf:producer id="pageViews"/>
</cewolf:data></cewolf:chart>
<p><cewolf:img chartid="line" renderer="cewolf" width="400" height="300"/>

0
 
LVL 86

Expert Comment

by:CEHJ
ID: 9883477
Isn't it the color attribute of colorpaint?
0
Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

 
LVL 86

Expert Comment

by:CEHJ
ID: 9883549
Actually - Tim Yates may know about this - i think you may be stuck with that particular example as it's using an image for the rendering. I could be entirely wrong though ;-)
0
 
LVL 3

Author Comment

by:applekanna
ID: 9883550
The graph produce s three lines each with a diferenct color I am not sure how cewolf chooses its colors.
I thought in I can give only one color colorpaint which makes me ask one more question, how do I specify  the color for each line in my graph?

i am adding the code from cewolf.tld for colorpaint .

<tag>
    <name>colorpaint</name>
    <tag-class>de.laures.cewolf.taglib.tags.ColorTag</tag-class>
    <description>
        Fills the area defined by the parent tag with a color.
    </description>
    <attribute>
        <name>color</name>
        <required>true</required>
        <rtexprvalue>true</rtexprvalue>
        <description>
            The color to be used to fill the parent tag's area.
            The color definition is compatible with the
            HTML one. E.g. black is '#000000' and red is '#FF0000'. However it
            is possible to append two hex numbers for the alpha channel. Thus
            '#FF000080' is red with alpha blending of 50%.
        </description>
    </attribute>
</tag>

Thx.
0
 
LVL 86

Accepted Solution

by:
CEHJ earned 250 total points
ID: 9883723
Maybe you should experiment 'manually' with some <point> tags? Here again you can specify color
0
 
LVL 92

Expert Comment

by:objects
ID: 9884850
I found cewolf pretty limited in it capabilities
0
 
LVL 3

Author Comment

by:applekanna
ID: 9885401
>>I found cewolf pretty limited in it capabilities

Can you suggest anything else to use.
Thx
0
 
LVL 92

Expert Comment

by:objects
ID: 9885443
Use JFreeChart directly, cewolf doesn't provide access to it's full feature set.
0
 
LVL 86

Expert Comment

by:CEHJ
ID: 10015586
8-)
0

Featured Post

Is Your Active Directory as Secure as You Think?

More than 75% of all records are compromised because of the loss or theft of a privileged credential. Experts have been exploring Active Directory infrastructure to identify key threats and establish best practices for keeping data safe. Attend this month’s webinar to learn more.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Suggested Solutions

Title # Comments Views Activity
base64 decode encode 12 121
eclipse formatting 6 73
HTTPSessionBindingListernter not configured in deployment descriptor 2 38
fibonacci ten numbers 4 28
Java had always been an easily readable and understandable language.  Some relatively recent changes in the language seem to be changing this pretty fast, and anyone that had not seen any Java code for the last 5 years will possibly have issues unde…
Java functions are among the best things for programmers to work with as Java sites can be very easy to read and prepare. Java especially simplifies many processes in the coding industry as it helps integrate many forms of technology and different d…
Viewers learn about the “while” loop and how to utilize it correctly in Java. Additionally, viewers begin exploring how to include conditional statements within a while loop and avoid an endless loop. Define While Loop: Basic Example: Explanatio…
Video by: Michael
Viewers learn about how to reduce the potential repetitiveness of coding in main by developing methods to perform specific tasks for their program. Additionally, objects are introduced for the purpose of learning how to call methods in Java. Define …

920 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question

Need Help in Real-Time?

Connect with top rated Experts

15 Experts available now in Live!

Get 1:1 Help Now