Quinn-Curtis Forums
Quinn-Curtis Forums
Home | Profile | Register | Active Topics | Members | Search | FAQ
Username:
Password:
Save Password
Forgot your Password?

 All Forums
 Tools for Java
 QCChart2D for Java
 Filling shapes a la fillPolygon()
 New Topic  Reply to Topic
 Printer Friendly
Author Previous Topic Topic Next Topic  

aquacalc

2 Posts

Posted - 01 Dec 2009 :  12:59:19  Show Profile  Reply with Quote
In my non-QCChart2D app, I override paintComponent() and pass fillPolygon() coordinates that represent the vertices of the figure I wish to fill.

I then fill either the lower or upper region of an irregular figure.

"Lower Region" => the x-axis is the lower boundary
"Upper Region" => the complement of the lower region
*********************************************
Thus far with QCChart2D, I can...

* fill lower regions

* fill upper regions when the fill boundary intersects the upper plot boundary, i.e. y = yMax

...but I cannot...

* fill the upper region when the boundary intersects the right plot boundary, i.e. x = xMax

* display upper fill when zooming an "upper-filled" region. In that case, the originally upper-filled region instead is displayed incorrectly as a *lower-filled* region.
*********************************************
I've played with the order in which I add the vertices to the SimpleDataset object, but without success.

Am I missing a method or flag that forces filling only the upper part of a polygon?

Or can you suggest a work-around?

I can e code based on the SimpleLinePlots and ZoomExamples tutorials that illustrate this issue.
*********************************************

Thanks,

--Nick Staresinic

quinncurtis

1164 Posts

Posted - 01 Dec 2009 :  14:03:28  Show Profile  Reply with Quote
Sorry, but I cannot see any workaround for what you describe. The SimpleLinePlot routines fill from the line defined by the dataset, to the y-value specified by the FillBaseValue( lineplot.setFillBaseValue).
Go to Top of Page

aquacalc

2 Posts

Posted - 01 Dec 2009 :  16:48:55  Show Profile  Reply with Quote
quote:
The SimpleLinePlot routines fill from the line defined by the dataset to the y-value specified by the FillBaseValue( lineplot.setFillBaseValue).



Thank you for that help; that's what I needed:

Combined with passing the proper polygon vertices in the proper order, I use a boolean to switch between setFillBaseValue(myYMin) when I want to fill a lower region and setFillBaseValue(myYMax) when I want to fill an upper region. This also solves the problem of displaying the correct fill region on zooming, as long as the zoom rectangle does not extend beyond the original plot area.
Go to Top of Page
  Previous Topic Topic Next Topic  
 New Topic  Reply to Topic
 Printer Friendly
Jump To:
Quinn-Curtis Forums © 2000-07 Quinn-Curtis, Inc. Go To Top Of Page
Powered By: Snitz Forums 2000 Version 3.4.07