Pregunta

I am trying to generate a time series with the area underneath filled with color.

Looking at examples of the jfreechart library there is this method:

ChartFactory.createAreaChart(...)

However the dataset required is a Category dataset, something quite different from the Time Series Dataset that I currently create:

ChartFactory.createTimeSeriesChart(...)

Which methods should I use to fill with color the area underneath the plotted line?

Thank you!

¿Fue útil?

Solución

Add the following after you create the a chart (using createTimeSeriesChart)

XYPlot plot = (XYPlot) chart.getPlot();
plot.setRenderer(new XYAreaRenderer());
Licenciado bajo: CC-BY-SA con atribución
No afiliado a StackOverflow
scroll top