Annotation/Crosshair drawing over axis labels - Help asap!!

A discussion forum for JFreeChart (a 2D chart library for the Java platform).
Locked
ormstont
Posts: 9
Joined: Wed Aug 09, 2006 2:07 pm

Annotation/Crosshair drawing over axis labels - Help asap!!

Post by ormstont » Wed Aug 23, 2006 8:57 am

I'm trying to deliver an implementation of JFreeChart but have found a big problem in the drawing of crosshairs and annotations.

When these run over the edge of the chart (for example when scrolling zoomed in) they continue to be drawn even when they are outside the plot area. This makes the axes look very messy, as can be seen in the screenshot below.

Would appreciate any help as soon as possible - is driving me crazy and haven't found anything on the forum after searching!

Image
Click for full size

moonblade
Posts: 21
Joined: Mon Sep 18, 2006 9:41 am

Post by moonblade » Tue Mar 13, 2007 9:32 am

Yes, i have the same matter too .. It is triggered when we scroll to the right, and the annotations get out of the boundaries and overlap the category labels.

Have you found your fix ? I've tried the newest release of 1.0.4 with the same result ..

Any idea guys ? helpppp xD

ormstont
Posts: 9
Joined: Wed Aug 09, 2006 2:07 pm

Post by ormstont » Tue Mar 13, 2007 9:45 am

No...still haven't found a fix but my app is now several stages on from my first post and I have a lot more annotations. You're right...it occurs when scrolling to the right and with more annotations my axis labels are now completely unreadable because of the overlaps.

I've also tried the latest version but the problem still doesn't seem to be fixed.

Please, anyone in the know, help?! Thanks!!

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Mar 13, 2007 12:13 pm

I've committed a patch to CVS to fix the problem with the range crosshair on a CategoryPlot being drawn outside the plot's bounds. This fix will be included in the 1.0.5 release. Now I'll see if I can reproduce the problem with annotations...
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Tue Mar 13, 2007 12:32 pm

OK, I see the problem with the annotations also (for CategoryPlot). A patch will go into CVS in a few minutes, for inclusion in the 1.0.5 release.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

ormstont
Posts: 9
Joined: Wed Aug 09, 2006 2:07 pm

Post by ormstont » Tue Mar 13, 2007 1:30 pm

That's brilliant, thanks so much for your help!

moonblade
Posts: 21
Joined: Mon Sep 18, 2006 9:41 am

Post by moonblade » Wed Mar 14, 2007 3:20 am

Thank you so much ... !
Wishing you and your family peace and joy !!

:)

moonblade
Posts: 21
Joined: Mon Sep 18, 2006 9:41 am

Post by moonblade » Wed Mar 14, 2007 4:50 am

Dear all,

Anyway, i've checked out the latest jfreechart and jcommon module from sourceforge cvs, build them, and use the resulted jars in my project.

But the domain axis and the range axis are just gone, all are now filled with the category plot contaning the gantt bars .. This isnt the case with <= 1.0.4

And also, when i right click at the category plot (the area that contains the gantt bars), and choose properties, NullPointerException occurs.

Is it because the cvs is not stable yet .. ?
Perhaps i should wait for the 1.0.5 ?

Or am i the only one facing this problem ... :D

Thanks ..

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Mar 14, 2007 9:46 am

The 1.0.x code in CVS is on a branch tagged STABLE_1-0-0 - make sure you check out that, and not the trunk.
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

ormstont
Posts: 9
Joined: Wed Aug 09, 2006 2:07 pm

Post by ormstont » Wed Mar 14, 2007 10:57 am

Managed to get that code and I can confirm it solves the problem perfectly...thanks so much!! You're a lifesaver!

moonblade
Posts: 21
Joined: Mon Sep 18, 2006 9:41 am

Post by moonblade » Wed Mar 14, 2007 12:38 pm

The 1.0.x code in CVS is on a branch tagged STABLE_1-0-0 - make sure you check out that, and not the trunk.
^________^

Thank you so muchh .. it works .. it works beautiful !

Anyway just want to inform that while building the stable branch, i found this exception :

Code: Select all

compile:
    [mkdir] Created dir: /home/moonblade/cvs/jfreechart/build
    [javac] Compiling 501 source files to /home/moonblade/cvs/jfreechart/build
    [javac] /home/moonblade/cvs/jfreechart/source/org/jfree/chart/renderer/xy/DeviationRenderer.java:293: moveTo(float,float) in java.awt.geom.GeneralPath cannot be applied to (double,double)
    [javac]                 area.moveTo(coords[0], coords[1]);
    [javac]                     ^
    [javac] /home/moonblade/cvs/jfreechart/source/org/jfree/chart/renderer/xy/DeviationRenderer.java:296: lineTo(float,float) in java.awt.geom.GeneralPath cannot be applied to (double,double)
    [javac]                     area.lineTo(coords[0], coords[1]);
    [javac]                         ^
    [javac] /home/moonblade/cvs/jfreechart/source/org/jfree/chart/renderer/xy/DeviationRenderer.java:300: lineTo(float,float) in java.awt.geom.GeneralPath cannot be applied to (double,double)
    [javac]                 area.lineTo(coords[0], coords[1]);
    [javac]                     ^
    [javac] /home/moonblade/cvs/jfreechart/source/org/jfree/chart/renderer/xy/DeviationRenderer.java:303: lineTo(float,float) in java.awt.geom.GeneralPath cannot be applied to (double,double)
    [javac]                     area.lineTo(coords[0], coords[1]);
    [javac]                         ^
    [javac] Note: Some input files use or override a deprecated API.
    [javac] Note: Recompile with -deprecation for details.
    [javac] 4 errors
Anyway, after i remove that file, the compile works, but the complete build failed .. but enough for me to get the jfreechart-1.0.4.jar

Thanks again .. :D

david.gilbert
JFreeChart Project Leader
Posts: 11734
Joined: Fri Mar 14, 2003 10:29 am
antibot: No, of course not.
Contact:

Post by david.gilbert » Wed Mar 14, 2007 12:47 pm

Thanks for reporting this. I'm currently developing on JDK1.6.0, which is why this slipped in (those methods are valid in the latest Java), but I'll get them removed before the release is made (we still aim for JRE1.3 compatibility).
David Gilbert
JFreeChart Project Leader

:idea: Read my blog
:idea: Support JFree via the Github sponsorship program

Locked