File APIs for Java Developers
Manipulate DOC, XLS, PPT, PDF and many others from your application.
http://aspose.com/file-tools
The moose likes Other Open Source Projects and the fly likes cewolf charts color Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "cewolf charts color" Watch "cewolf charts color" New topic
Author

cewolf charts color

anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Hi experts

I use cewolf to draw a chart in my jsp file.

I want to control set the color of the chart (of every series)

I use this code at the jsp file :

and to add to the dataset data I use this code :



how can I change the colors ?

success draws in blue color
and fail draws in red color

I want the success will draw in green color.
how can I change the color ?


thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
If you're using the cewolf distribution by me (and you should, it'll become the official one, see the link in my signature) then you can use de.laures.cewolf.cpp.SeriesPaintProcessor postprocessor for this. The cewolfset.jsp page of the example web app shows how to do that for pie charts.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
Could you please send me the example for color?

I could not find the example
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
Download the distribution from my web site. It contains a ready-to-run web app that has that JSP page.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
I have included the cewolfset.jsp page in my project. It is giving me this error
cewolfset.jsp(301,4) No tag "chartpostprocessor" defined in tag library imported with prefix "cewolf"
Error statusCode: 500

Can you help me please?

thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
You need to use it with the jar files that come with my distribution.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
I'm using for stackedverticalbar3d


In my jsp page. I have included like below.

I want to see differnet colors on this different categories. So far I have done like below.But I didn't see the different colors.










Can you correct me?

Thanks

Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
The chartpostprocessor tag is inside the gradientpaint tag - that won't work. It needs to be a child of the chart tag.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
I did it, but still don't see the different colors on categories.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
Take a look at the log file - it contains the explanation. The gist is that you can't define postprocessors in the JSP page; they'll need to be Java classes. But since the SeriesPaintProcessor works fine, there's no real need to do so.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
which log file I have to look?
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
The log file of your servlet container, whichever that may be. For Tomcat, it would be logs/catalina.out.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
I got this error


ChartPostProcessor org.apache.jsp.SummaryChart_jsp$1 implements neither Serializable nor NonSerializableChartPostProcessor. It will be ignored.


Did I miss anything?

Please let me know


Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
That's it. It tells you that the postprocessor class you defined won't be used, because it doesn't implement either one of those interfaces. Of course, it *can't* implement *any* interface, because it's defined in a JSP. That's what I meant earlier by saying that postprocessors need to be defined in Java code, not in JSPs.
anvi kon
Ranch Hand

Joined: Jan 08, 2010
Posts: 133
In java code, do I have to implement Chartpostprocessor and also Serializable?

Can you please give me some examples?

So that it is goig to help me.


Thanks
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42951
    
  72
The source code of the de.laures.cewolf.cpp.SeriesPaintProcessor class is a good example, because it does exactly what you're asking. I'm still not sure why you don't want to use that, though, and instead insist on rolling your own.
Ole V. Villumsen
Greenhorn

Joined: Feb 18, 2010
Posts: 10
anvi kon wrote:


Just a detail: <cewolf:param name="0" value="#00FF00" /> is simpler.
Thanks, Ulf, for cewolf 1.1, and for very helpful interaction here. I've just started using SeriesPaintProcessor.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cewolf charts color