JFreeChart has a class called LineFunction2D(double YIntercept, double Slope). I can get the JFreeChart examples to work, but I can’t get LineFunction2D to work. How can I add the line graph to a JFreeChart object?
LineFunction2D line = new LineFunction2D(.03125, (.125 - .03125));
//missing code goes here
JFreeChart chart = new JFreeChart(Plot plot);
ChartPanel panel = new ChartPanel(chart);
Thanks!
(I’m working on the sscce, and will post it soon.)
I think that the code you are looking for is the call to
DatasetUtilities.sampleFunction2Dto convert the dataset into amXYDatasetthat you can add to your plot…