Hi ,
Any help on the above issue.It will be helpful if we get any sample implementation code.
Thanks,
SAT
How to remove Intermediate Intervals in Y aixs of Step Chart
Re: How to remove Intermediate Intervals in Y aixs of Step Chart
its a long job..
EDIT: yeah i tried but it looks long if you want to change the whole label processing system
EDIT: yeah i tried but it looks long if you want to change the whole label processing system
Re: How to remove Intermediate Intervals in Y aixs of Step Chart
add this method to org.jfree.text.TextUtilities
and in ValueAxis class line 705, replace the method call to
you can set a flag system on ValueAxis (a boolean isSuperscored for example) and make an if check for this method. that would look nicer
Code: Select all
public static void drawLogString(final String text, final Graphics2D g2,
final float x, final float y, final TextAnchor textAnchor,
final double angle, final TextAnchor rotationAnchor) {
if ((text == null) || (text.equals(""))) {
return;
}
final float[] textAdj = deriveTextBoundsAnchorOffsets(g2, text,
textAnchor);
final float[] rotateAdj = deriveRotationAnchorOffsets(g2, text,
rotationAnchor);
final AffineTransform saved = g2.getTransform();
// apply the rotation...
final AffineTransform rotate = AffineTransform.getRotateInstance(
angle, x + textAdj[0] + rotateAdj[0], y + textAdj[1] + rotateAdj[1]);
g2.transform(rotate);
int scoreIndex = text.indexOf('^');
if(scoreIndex != -1) {
StringBuilder text1 = new StringBuilder(text.length()-1);
text1.append( text.substring(0,scoreIndex) ).append( text.substring(scoreIndex+1) );
AttributedString as = new AttributedString(text1.toString());
as.addAttribute(TextAttribute.SUPERSCRIPT, TextAttribute.SUPERSCRIPT_SUPER,
scoreIndex, text1.length());
g2.drawString(as.getIterator(), x + textAdj[0], y + textAdj[1]);
}
else g2.drawString(text, x + textAdj[0], y + textAdj[1]);
g2.setTransform(saved);
}
and in ValueAxis class line 705, replace the method call to
Code: Select all
TextUtilities.drawLogString(...)