This week's book giveaway is in the General Computing forum.
We're giving away four copies of Emmy in the Key of Code and have Aimee Lucido on-line!
See this thread for details.
Win a copy of Emmy in the Key of Code this week in the General Computing forum!
  • 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 all forums
this forum made possible by our volunteer staff, including ...
Marshals:
  • Campbell Ritchie
  • Liutauras Vilda
  • Junilu Lacar
  • Jeanne Boyarsky
  • Bear Bibeault
Sheriffs:
  • Knute Snortum
  • Devaka Cooray
  • Tim Cooke
Saloon Keepers:
  • Tim Moores
  • Stephan van Hulst
  • Tim Holloway
  • Ron McLeod
  • Carey Brown
Bartenders:
  • Paweł Baczyński
  • Piet Souris
  • Vijitha Kumara

Issue defining axis range in cewolf plots

 
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Hi all,

I'm a relatively new JSP programmer and am working on project that needs to display dynamic graphs in a web page. I stumbled across cewolf a couple days ago and it seemed to be exactly what I was looking for. I've managed to get the basic functionality that I need working (reading in data from a changing text file, outputting many different datasets on one plot in a web browser, etc) and cewolf has been perfect.

However, I've run into my first problem with cewolf that I can't seem to find a simple answer to and I was wondering if anyone here can help me out.

I'm tracking small fluctuations in temperature data and the changes I need to see are on the order of 0.1 degree increments with a total range change of 1-2 degrees. I've found that cewolf sets the y-axis range such that the minimum value can never be greater than 0. This means that my small temperature changes at 60 degrees are barely visible (graph looks basically like a straight line) because the y-axis is stuck with a minimum value of 0 (range 0-~65)...not very helpful for analyzing the data real time...

Is there any way to set the bounds for the axes on a cewolf graph?

This would also be really helpful later on when I want to implement "zooming" capabilities on my graphs...

Thanks so much in advance for any advice/help!
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Welcome to JavaRanch.

If you're using the cewolf distribution put out by me (and you should, it'll become the official distribution in the not-too-distant future, see the link in my signature) then you can use the de.laures.cewolf.cpp.VisualEnhancer postprocessor to achieve this. In your JSP, you'd have something like this:

Both "border" and "rangeIncludesZero" can have values of "true" or "false". The "rangeIncludesZero" attribute is new, though, so if you downloaded the distribution before you'll need to do it again now.
 
Ann Kappy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thank you so much for the quick reply! I tried it out this morning in my code and it worked like a dream - I can now actually see the small fluctuations in my data - I'm so excited!

I had downloaded your cewolf distribution (after reading a number of topic threads about cewolf on JavaRanch) but didn't know just how much added functionality it had. Thank you for maintaining the cewolf distribution, it really is a very user friendly kit for implementing graphical displays in web pages.

One additional question on this same topic - in the future I hope to implement a functionality that allows the user to dynamically (through an html form) change the way the data is displayed on the graph. I hope to put in an option that would enable the user to define the x-axis and y-axis range to essentially "zoom in" on a point or section in the graph. Is there any way to define the axis range at this point in your distribution? (On a quick scan of the cpp classes I didn't see anything, but it might have been an oversight on my part)

Thank you again!
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the kind words - it's always good to hear that people get some use out if it.

There's no support for zooming at the moment, but it shouldn't be hard to write a PostProcessor to do that. The ValueAxis class has several methods that could be used to implement it in various ways:
 
Ann Kappy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks for the help/tips!

I went about trying your suggestion to make a quick PostProcessor. I based it heavily off of your VisualEnhancer PostProcessor I was already using and managed to make a "zoom" PostProcessor that does exactly what I was looking for. I'm still working out a few of the bugs in the project (primarily with passing/setting parameters between the html form and the class using beans), but those are mainly caused by my elementary knowledge with the java/html relationship...there's always something to work on. I'm just excited that what seemed like a lost cause two days ago (my last resort was posting on this forum before giving up on cewolf entirely and trying a different way of displaying the data) is now an operational part of my developing website.

Anyway, thanks again so much for your help! If (more likely when) I get completely stuck again, I'll be back.
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Excellent! If you don't mind (and your company is fine with it), I'd be happy to add the PostProcessor and the related code as an example to the cewolfexample web app.
 
Ann Kappy
Greenhorn
Posts: 4
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
I definitely don't mind - that would be great!

I can pass you the PostProcessor, and I think I can pass you the example code that runs the PostPrcoessor (although I'll have to check with my manager on that). If I can't pass the specific code I'm using it in I can definitely write up a really quick example code and pass that along with it.

I'm still working out some minor bugs in the example code (which in turn is altering the PostProcessor code to make it more functional) and if you're going to add it to the cewolf package I'll probably add some of the additional capabilities from the ValueAxis class (I only used setRange and resizeRange in my code). Is it alright if I pass it to you sometime later this week?

Also, what is the best way to send the code to you?
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
That's great. There's no rush - I fiddle with cewolf periodically, so whenever it's ready I can add it. My email address is in my profile page.
 
Squanch that. And squanch this tiny ad:
Java file APIs (DOC, XLS, PDF, and many more)
https://products.aspose.com/total/java
  • Post Reply Bookmark Topic Watch Topic
  • New Topic
Boost this thread!