aspose file tools*
The moose likes Other Open Source Projects and the fly likes cewolfexample (cewolf-1.1-ulf) Big Moose Saloon
  Search | Java FAQ | Recent Topics | Flagged Topics | Hot Topics | Zero Replies
Register / Login


Win a copy of Spring in Action this week in the Spring forum!
JavaRanch » Java Forums » Products » Other Open Source Projects
Bookmark "cewolfexample (cewolf-1.1-ulf)" Watch "cewolfexample (cewolf-1.1-ulf)" New topic
Author

cewolfexample (cewolf-1.1-ulf)

James Tok
Greenhorn

Joined: May 19, 2010
Posts: 4
Hi, i have no idea how to view or use the cewolfexample. Please tell me know how to import cewolfexample to MyEclipse? Do i need to change anything in the cewolfexample folder?
Thanks in advance!
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42281
    
  64
cewolfexample.war is a ready-to-run web app. Just drop it into the webapps directory of your Tomcat (or whatever servlet container you're using) server, and it should pick it up automatically. It does not contain Java source code, so there isn't much point in importing it into Eclipse.


Ping & DNS - my free Android networking tools app
James Tok
Greenhorn

Joined: May 19, 2010
Posts: 4
Ulf Dittmer wrote:cewolfexample.war is a ready-to-run web app. Just drop it into the webapps directory of your Tomcat (or whatever servlet container you're using) server, and it should pick it up automatically. It does not contain Java source code, so there isn't much point in importing it into Eclipse.


Thanks.
what is the difference between a line chart and a XYline chart?
and cuold i use the line chart in overlaid chart?
Thanks again.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42281
    
  64
what is the difference between a line chart and a XYline chart?

The former uses a CategoryPlot, while the latter uses an XYPlot. See the JFreChart docs for the differences between them, or check the example charts in the web app.

and cuold i use the line chart in overlaid chart?

Possibly. Give it a try and let us know :-)
James Tok
Greenhorn

Joined: May 19, 2010
Posts: 4
okay, last question, i try to overlaid both bar chart and line chart which both are using the CategoryPlot, thus i have a question, for type how should I set it? type="overlaidxy" ? or?
please guide.





and for OverlayPostProcessor.java



how to change XYItemRenderer ?


Many Thanks.
Michael Yundt
Greenhorn

Joined: Dec 08, 2011
Posts: 3

Good morning, Ulf.
I need a little help with formatting an overlaidchart. I do have the JFreeChart developer guide and the JavaDocs for it and the cewolf code and tld.

Here's the jsp portion:


I'm not sure how to embed an image...yet...so I'll have to describe the issue:
It displays vertical bars in 2 series plus one (or two) lines, all by date.

1. I am able to center the bars around the domain axis label ticks, but not the line points
2. I am unable to change the thickness of the lines
3. I am unable change the width of the individual bars/set a spacing between them

It is my understanding that I need to use XYDataset for both the bargraph (verticalbar) plot and line (xyline).

So far I've managed to get all of the other tasks to work, but I need help on this one.


Grr. Argh.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42281
    
  64
You can attach images to posts via the "Attachments" tab when writing a post/reply; that's between the text field for the post and the Preview/Submit buttons.

I haven't ever used Overlaid charts, so it's hard to know where to start. Can you post an SCCEE (meaning, a minimal example of Java and JSP code that is ready to be dropped into a cewolf web app) of what you have? That would allow me to get into it quickly.
Michael Yundt
Greenhorn

Joined: Dec 08, 2011
Posts: 3

Here's the applicable portion of the JSP:


The cewolfverlaidchart contains two plots: an xyline fed by the BudgetDatasetProducer, and an xyverticalbar fed by the SalesDatasetProducer, both of which populate a TimeSeriesCollection with two TimeSeries each. There is also a ChartPostProcessor (BudgetPostProcessor) that is used for formatting, but only seems to affect the xyverticalbar plot.

This is the BudgetDatasetProducer for the xyline plot:


...and the SalesDatasetProducer:


The BudgetPostProcessor:


Thank you for your help,
Michael Yundt
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42281
    
  64
I was actually thinking of something I could run for myself - so it would have all the data hardcoded somewhere. (And wouldn't be missing the imports, so it could be compiled.)
Michael Yundt
Greenhorn

Joined: Dec 08, 2011
Posts: 3

I edited the previous code and included hard-coded data, plus removed anything not needed. You should be able to created and compile these classes.
Ulf Dittmer
Marshal

Joined: Mar 22, 2005
Posts: 42281
    
  64
OK, after some minor fixes (replacing "DateUtils.getCurrentYear()" by "new Date().getYear()+1900", removing an extra parenthesis in the populateDataset method) I was able to get the Java code to compile. I couldn't run the JSP due to external dependencies (JSF and a4j), but after throwing out everything unnecessary it compiles, but then throws an IndexOutOfBoundsException at runtime. So, still no dice. Unfortunately I'm now out of time. I'm attaching the JSP I'm using below; if you can fix the Java code so that it all compiles and runs I'll take another look.

This has nothing to do with the problem at hand, but I notice it uses the server's screen dimensions (via the AWT Toolkit class), apparently to calculate the chart size - how do you imagine that to work? The server has no access to the client's screen size.
 
I agree. Here's the link: http://aspose.com/file-tools
 
subject: cewolfexample (cewolf-1.1-ulf)