I'm using JRuby to access JFreeChart. But I can't seem to set a domain marker on the date axis... Can anyone tell me why this is not working?
def create_plot
rangeaxis = NumberAxis.new
rangeaxis.setAutoRangeIncludesZero(true)
daxis = DateAxis.new
daxis.setRange( Time.at(@dataset['date_start'].to_i) , Time.at(@dataset['date_end'].to_i) )
@plot = XYPlot.new(@datasets.first, daxis, rangeaxis, @base_renderer)
@plot.setDatasetRenderingOrder(DatasetRenderingOrder::FORWARD)
@plot.setBackgroundPaint(java.awt.Color.white)
lol = IntervalMarker.new( 0, 99999999999, java.awt.Color.gray, BasicStroke.new(2.0), java.awt.Color.gray, nil, 1.0 )
lol.setLabel("ARGH")
@plot.addDomainMarker(lol)
end
Even though the marker is supposed to cover January 1970 to November 5138 with a gray area, it's not showing. If I replace the call with addRangeMarker, it works but I want it on the other axis.
Thanks for any replies!