Since Java 8u40, the org.jfree.chart.fx.FXGraphics2D managed the dashed lines.
So I modified the bridge fx on FXGraphics2D.java
Code: Select all
public void setStroke(Stroke s) {
nullNotPermitted(s, "s");
this.stroke = s;
if (stroke instanceof BasicStroke) {
BasicStroke bs = (BasicStroke) s;
double lineWidth = bs.getLineWidth();
if (lineWidth == 0.0) {
lineWidth = this.zeroStrokeWidth;
}
this.gc.setLineWidth(lineWidth);
this.gc.setLineCap(awtToJavaFXLineCap(bs.getEndCap()));
this.gc.setLineJoin(awtToJavaFXLineJoin(bs.getLineJoin()));
this.gc.setMiterLimit(bs.getMiterLimit());
//Dasehd lines management
float[] dash = bs.getDashArray();
if (dash != null && dash.length > 1){
for (int i=0; i<dash.length; i++){
this.gc.setLineDashes(dash[i]);
}
this.gc.setLineDashOffset(bs.getDashPhase());
}
else{
double[] actualDash = this.gc.getLineDashes();
if (actualDash != null){
for (int i=0; i<actualDash.length; i++){
this.gc.setLineDashes(0);
}
this.gc.setLineDashOffset(0);
}
}
}
}
Thanks again for your work.
Best regards,
Sophie