• Post Reply Bookmark Topic Watch Topic
  • New Topic
programming forums Java Mobile Certification Databases Caching Books Engineering Micro Controllers OS Languages Paradigms IDEs Build Tools Frameworks Application Servers Open Source This Site Careers Other Pie Elite all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Jeanne Boyarsky
  • Ron McLeod
  • Paul Clapham
  • Liutauras Vilda
Sheriffs:
  • paul wheaton
  • Rob Spoor
  • Devaka Cooray
Saloon Keepers:
  • Stephan van Hulst
  • Tim Holloway
  • Carey Brown
  • Frits Walraven
  • Tim Moores
Bartenders:
  • Mikalai Zaikin

cewolfexample (cewolf-1.1-ulf)

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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!
 
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
James Tok
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator

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
Posts: 4
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Greenhorn
Posts: 3
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
Ulf Dittmer
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
Here's the applicable portion of the JSP:


The cewolf:overlaidchart 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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Posts: 3
Netbeans IDE Tomcat Server Java
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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
Rancher
Posts: 43081
77
  • Mark post as helpful
  • send pies
    Number of slices to send:
    Optional 'thank-you' note:
  • Quote
  • Report post to moderator
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.
 
The knights of nee want a shrubbery. And a tiny ad:
a bit of art, as a gift, the permaculture playing cards
https://gardener-gift.com
reply
    Bookmark Topic Watch Topic
  • New Topic