I have an XYPlot on which i want some dotted and some dashed lines.
As basic example i used http://www.jfree.org/phpBB2/viewtopic.p ... yle+dotted
The point in this example is :
Code: Select all
float lineWidth = 0.2f;
float dash[] = {5.0f};
float dot[] = {lineWidth};
if (style.equalsIgnoreCase(STYLE_LINE)) {
result = new BasicStroke(lineWidth);
} else if (style.equalsIgnoreCase(STYLE_DASH)) {
result = new BasicStroke(lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 10.0f, dash, 0.0f);
} else if (style.equalsIgnoreCase(STYLE_DOT)) {
result = new BasicStroke(lineWidth, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, 2.0f, dot, 0.0f);
}
Code: Select all
float miterlimit = 1.0f;
float dash[] = {10.0f};
float dot[] = {1.0f};
float dash_phase = 0.0f;
render.setSeriesStroke(ls.series, new BasicStroke(8, BasicStroke.CAP_BUTT, BasicStroke.JOIN_MITER, miterlimit, dash, dash_phase));
Anybody an idea ?
Thank you !