The second series was meant to be vertical. The graph I am trying to achieve is something like this:
http://i7.photobucket.com/albums/y260/- ... fpdftb.gif
My understanding from the earlier posts in this thread was that you were suggesting drawing the curve as the first series, and drawing the vertical line as the second series, and then filling in the area between the series.
Just to explain what I was trying to do before
double f = 2; // point along the X axis where to draw the line
XYSeries fLine = new XYSeries("fLine");
fLine.add(f, 0); // first point in series drawn at value 2 along the bottom of x axis
fLine.add(f, group.getValue(f)); // second point drawn directly above first point (in order to create vertical line) and at the point which intersects with the curve
dataset.addSeries(fLine);
Replacing the code you suggested did not work for me, I just got an IndexOutOfBoundsException exception.
How make a normal distribution using JFreeChart?
-
- Posts: 844
- Joined: Fri Oct 13, 2006 9:29 pm
- Location: Sunnyvale, CA
That is because I transposed the x and y values when I transcribed the code by hand. Try:J. wrote:Replacing the code you suggested did not work for me, I just got an IndexOutOfBoundsException exception.
Code: Select all
XYSeries fLine = new XYSeries("fLine");
fLine.add(0, 0);
fLine.add(2, 0);
dataset.addSeries(fLine);
Richard West
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA
Design Engineer II
Advanced Micro Devices
Sunnyvale, CA