My data had Y-values that were all around the 1.217 to 1.219 billion data range; however, JFreeChart was auto calculating the proper orientation of the graph and making the range start from zero and end at my highest range value. This makes my data which should look like a slope=1 sideways line look instead like a slope=0 flat line.
JFreeChart has a method in the NumberAxis class called ‘setAutoRangeIncludesZero’ which lets you choose whether to start your range from zero by default. Unfortunately, my ‘RangeAxis’ object was of type ValueAxis, and this class doesn’t have any such method.
Here is the solution:
NumberAxis yaxis = (NumberAxis) chart.getXYPlot().getRangeAxis();