• Status: Solved
  • Priority: Medium
  • Security: Public
  • Views: 482
  • Last Modified:

Jfreecharc colors

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
applekanna
Asked:
applekanna
  • 5
  • 5
  • 2
  • +1
1 Solution
 
jimmackCommented:
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
 
applekannaAuthor Commented:
>>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
 
applekannaAuthor Commented:
Also wanted o know if there was any other way to do this.
Thank you.
0
Free Tool: Port Scanner

Check which ports are open to the outside world. Helps make sure that your firewall rules are working as intended.

One of a set of tools we are providing to everyone as a way of saying thank you for being a part of the community.

 
CEHJCommented:
Can't you set the color directly in the page tag?
0
 
jimmackCommented:
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
 
applekannaAuthor Commented:
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
 
CEHJCommented:
Isn't it the color attribute of colorpaint?
0
 
CEHJCommented:
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
 
applekannaAuthor Commented:
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
 
CEHJCommented:
Maybe you should experiment 'manually' with some <point> tags? Here again you can specify color
0
 
objectsCommented:
I found cewolf pretty limited in it capabilities
0
 
applekannaAuthor Commented:
>>I found cewolf pretty limited in it capabilities

Can you suggest anything else to use.
Thx
0
 
objectsCommented:
Use JFreeChart directly, cewolf doesn't provide access to it's full feature set.
0
 
CEHJCommented:
8-)
0
Question has a verified solution.

Are you are experiencing a similar issue? Get a personalized answer when you ask a related question.

Have a better answer? Share it in a comment.

Join & Write a Comment

Featured Post

Cloud Class® Course: Python 3 Fundamentals

This course will teach participants about installing and configuring Python, syntax, importing, statements, types, strings, booleans, files, lists, tuples, comprehensions, functions, and classes.

  • 5
  • 5
  • 2
  • +1
Tackle projects and never again get stuck behind a technical roadblock.
Join Now