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

Cewolf : how to paint specific point

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

I have a problem.

i have a timeseries chart, and i need to "make a specific point in the series to be different from the others... ( maybe a new color shape/etc). and there is a condition for that.. (when the y value is higher than a limit.. that point need be diferent from the others )

i was checking how to configure lines/shapes/etc. but didnt think in how to bypass this problem..

Thanks in advance...

Phillip
 
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
The easiest way would be to use annotations - see the "Annotations" page of the example web. The text could be blank if you just want the pointing arrow.
 
Phillip Sulvan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer for the answer.

yes. i am reading atm about the annotations.

if it works here would be nice.. but i dont know if it will be possible cause there are some doubts...

i mean..looking at the example...



how i would get the "X" value in a timeseries chart?
the annotations only "print" a specific point? i dunno if i was clear enough (sorry if not ) but i need all points that are higher than a determinated value... so, that results in more than one annotation in the chart... maybe tons of annotations ( more than one for each serie ).....

Thanks,

Phillip

Edit1 :
The "X" Value..seems i figured out.. time need be in milliseconds....(working here like the example when i add a specific x,y pos, now need check if possible to print more annotations accordinly with the data i have.. and how)...


 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You're right, annotations don't work well for multiple successive points. But I've just released a new version with an enhanced LineRendererProcessor - it has a couple of attributes that allow you to control the display of noticeable shape at each point, the color of that shape, and whether or not the shape is solid or outlined. This is achieved by passing in an expression that is evaluated for each point. For example, "and (x>=0, y>=0)" would mark all points for which x>=0 and y>=0. The javadocs have more detail about what's possible. Being a string, the expression can also contain EL expressions (like "and (x>=${x}, y>=${y})") so you can use context attributes that get set somewhere in the servlet code. See the annotations.jsp page for an example.
 
Phillip Sulvan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Thanks Ulf Dittmer.

It solved tons of my problems this implementation, now there is just one ( i think, kinda simillar)
I did a jfreechart chart for multiples annotations and the result was kinda good. i was reading the javadoc about those conditionals... is there anyway to "compare" the value(series,x,y) with a dataset(or a List<>) and if equals do the shape/fill etc?

i mean i have the database. i do the query and fill the timeseriescollection with the series.. but jfreechart dont "make" you add a "control point like" to the timeseriesitem. so while i am running my resultset i created a List<paramclass> with the atributes (t,x) (t for position of the timeseries inside of timeseriescollection, and x for position of value inside the timeseries)...
then after i created the annotations on jfreechart and used a for to run the List filling the chart with "a red circle" in each "point" of the List..


i did with multiples annotations that on jfreechart.. but i didnt understand how i would do that on shape/fill for each point on jfreechart.. so this is why i am asking if there is a way to do that on cewolf with this new feature.. or if not, how to do that using jfree?

Thanks in advance.
Phillip
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
Did you check out the demo of the "condition" feature on the Annotations page? It's just coincidental that it happens to be on that page, it is independent of annotations. And it lets you define a single expression that will be evaluated for each point, making it possible to show or not show a shape at each point.

I thought that's what you described before, but I don't really follow the last post, so maybe you're talking about something else.
 
Phillip Sulvan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You thought right. It was kinda what i was trying to achieve. to paint or not determined points.

i checked the demo( did some tests, kinda apply it to my charts ) but still there is one more type i think.. or i dunno how to make the "right" expression:

the case is : when i build my dataset, i define "certain points" to be or not be paint accordinly with a flag inside the database ..i did it using annotations with a List with which to "paint or not".
so, basically i need to compare or check a list with the coordinates to paint or not...

that is being the biggest problem so far

Phillip
 
Phillip Sulvan
Greenhorn
Posts: 12
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
hi again...

managed to do that in jfree using a customxylinerender class and implementing the methods



anyway thanks, but if you have some idea how to "manage" the fill/visible/paint comparing to a dataset with cewolf i will be very thankfull to you ^^
 
Ulf Dittmer
Rancher
Posts: 43011
76
  • Mark post as helpful
  • send pies
  • Quote
  • Report post to moderator
You could write a postprocessor that sets the renderer you have written for the chart/plot in question. The de.laures.cewolf.cpp.BarRendererProcessor class is an example of doing that.
 
And when my army is complete, I will rule the world! But, for now, I'm going to be happy with 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!