Search code examples
jfreechartredhatmarkerheadless

JfreeChart and ValueMarker not displayed (headless environment)


I have a problem while generating a chart. Every part on the chart is well generated except a ValueMarker which is not. I am working on a web application in a headless RedHat environment. I got another problem for the chart generation (which is now solved), the description of my environment is here :

JFreeChart strange rendering (headless RedHat)

It is working perfectly on Windows. The piece of code adding the ValueMarker is :

Marker distanceTiers = new ValueMarker(Double.parseDouble(resultDistance.replace(Constants.UNITE_DISTANCE, "")));
distanceTiers.setPaint(Color.BLACK);
plot.addDomainMarker(distanceTiers);

Here is what I obtain, I am supposed to get a vertical line at X = 40 and I cannot figure out why everything except this line is going well :

http://img809.imageshack.us/img809/6050/graph20120803141353.png

If someone has an explanation for this, please do not hesitate.


Solution

  • It's not clear where you get the domain value used to construct the ValueMarker, but you might compare your approach to that shown in this Q&A