draw smooth dash-ed line
i am working on a project that displays graph, a graph can be drawn as simple plain line , dash-ed line , dotted line or dash -dotted line. i don't have any problem with drawing all these of lines , but the problem is lines are not so smooth and if i zoom my graph they become very rough.
please suggest some dash-type for BasicStroke object such that line would be smoother(if possible please explain mechanism for drawing smooth line)
setStroke(new BasicStroke(nPathWidth, BasicStroke.CAP_ROUND, BasicStroke.JOIN_ROUND, 10.0f, fDashType, //<-- i want this value for dash-ed line , dotted line or dash -dotted line 0f));
I presume you are working with Java2D and are drawing to a Graphics...have you tried to set the antialiasing to on? See Enabling Antialiasing | Example Depot