|
Fill opposite area |
Posted by Lofi on Jun-30-2013 14:49 |
|
When you fill a chart line you usually fill from y-axis-bottom to the chart line. Is it possible to fill the opposite, i. e. from y-axis-top down to the chart line?
Example usage: I have 3 chart lines and a 4th which is a threshold-line. I'd like to see where the 3 chart lines overlap into the 4th threshold line.
Thank you very much! |
Re: Fill opposite area |
Posted by Peter Kwan on Jul-01-2013 23:45 |
|
Hi Lofi,
Yes. If you are drawing in 2D (that is, 2D area chart, as opposed to 3D area chart), you can color the region between any two lines, including your 3 chart lines and the 4th threshold line. See the Inter-Line Coloring sample code for an example:
http://www.advsofteng.com/doc/cdjava.htm#linefill.htm
The above sample code demonstrates that you can color the region between two lines (or a line and a "mark"), and the color can depend which line is on top. You can set one of the colors to Chart.Transparent if you just want to color one of the sides.
The mark line can be set to a large value (eg. y = 99999). In this way, the filling will be from the top.
Another method is to use the Layer.setBaseLine method to configure where the filling begins.
Hope this can help.
Regards
Peter Kwan |
|