Print issues with graph and annotation

TeeChart for Java (NetBeans, Eclipse, Android Studio, etc)
Post Reply
Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Print issues with graph and annotation

Post by Turc » Mon Aug 30, 2010 6:25 pm

When i try to print (using similar code to the example provided in the features), it prints, but the the annotation's position gets screwed up. Also, it sets the charts background to white, thus hiding the labels.

Any feedback on whether this is a bug, and if so, when will it be fixed?

Thanks

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: Print issues with graph and annotation

Post by Turc » Mon Aug 30, 2010 6:28 pm

Here's the code that gets executed when the Print Button is pressed

Code: Select all

PreviewDialog d = new PreviewDialog(chart);
d.setModal(true);
d.setVisible(true);

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: Print issues with graph and annotation

Post by Turc » Mon Aug 30, 2010 7:29 pm

It also puts another copy of the chart on top of the original copy but moved a bit to the top and a little to the right.

Yeray
Site Admin
Site Admin
Posts: 9613
Joined: Tue Dec 05, 2006 12:00 am
Location: Girona, Catalonia
Contact:

Re: Print issues with graph and annotation

Post by Yeray » Thu Sep 02, 2010 8:42 am

Hi Turc,

I've seen that the background color is set to white and the annotation, if you don't change the margins in the preview dialog, isn't shown.
I've also seen that if you change the margins, they don't seem to be respected and all the paper is taken.
I've added it to the defect list to be fixed in future releases (TJ71015133)
Turc wrote:It also puts another copy of the chart on top of the original copy but moved a bit to the top and a little to the right.
I haven't been able to reproduce it. Here it is the project I used to test it.
NetBeansProjects.zip
(122.07 KiB) Downloaded 1134 times
Could you modify it so we can reproduce the problem here?
Best Regards,
ImageYeray Alonso
Development & Support
Steema Software
Av. Montilivi 33, 17003 Girona, Catalonia (SP)
Image Image Image Image Image Image Please read our Bug Fixing Policy

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: Print issues with graph and annotation

Post by Turc » Mon Oct 04, 2010 2:14 pm

Is there a set date for when this bug is going to get fixed?

Or should i work around it and fix it myself just like i've done for 80% of your "features"?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Print issues with graph and annotation

Post by Marc » Fri Oct 08, 2010 9:11 am

Hello,

Re.
fix it myself just like i've done for 80% of your "features"?
ouch.

We are checking through the points in question and should hopefully be able to get any applied resolution to you for testing early next week.

Regards,
Marc Meumann
Steema Support

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Print issues with graph and annotation

Post by Marc » Wed Oct 13, 2010 1:17 pm

Hello,

As a followup, the issues are taking a little longer to resolve than initially expected but we should be able to make an build available shortly.

Regards,
Marc
Steema Support

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: Print issues with graph and annotation

Post by Turc » Wed Oct 13, 2010 10:09 pm

Thank you for the update. Will this fix also keep any objects on the chart in sync when printed?

Also, I currently add annotations to a chart. When the chart is scrolled/moved horizontally, i update the annotations positions so that they seem to move with the chart. The issue is that when i have a lot of things going on in my program, the annotations lag when the chart is scrolled/moved. Is there a command that i don't know about that will grab the annotation and fuse it to the chart so that i don't have to keep updating the annotation's position, which in result will remove the lag issues that im currently experiencing?

Marc
Site Admin
Site Admin
Posts: 1272
Joined: Thu Oct 16, 2003 4:00 am
Location: Girona
Contact:

Re: Print issues with graph and annotation

Post by Marc » Fri Oct 15, 2010 4:37 pm

Hello,

For other versions of TeeChart (VCL, NET, AX), metafile (ie. vector Windows metafile wmf) format is available at print time. That allows a whole-chart rescale for the printable page whilst respecting all respective locations. Vector output isn't available natively to swing/awt in Java and that has led to some delay with the work inhand. There are some alternatives that are being studied.

One alternative that is tested with some degree of success but that may have to be considered a halfway house is to adjust an annotation's position with respect to new Chart size at print time, relative to the annotation position on the form-visible chart. That is fine for one of the fixed position annotations (left-top, right-top, etc) but runs the risk, for custom-positioned annotations, of moving the position of an annotation that may already have a dynamic position coded by the designer. That relates somewhat to your question:

Re.
Is there a command that i don't know about that will grab the annotation and fuse it to the chart
You may already be using this technique to scroll the annotation on the Chart but if not it might be worth taking note as this would be the preferred option to custom-positioning just about any custom item on the Chart. ie. to always relate the items position to an axis location, whether that be some fixed axis location such as 0,0 or a data point location (ie. tag-labelling a point as it scrolls across a moving chart). This also resolves positioning issues at print time.

eg.

Code: Select all

/*(*note tool1 = new Annotation(chart1.getChart());)*/

chart1.addChartPaintListener( new com.steema.teechart.events.ChartPaintAdapter() {
    public void chartPainted(ChartDrawEvent pce) {

        Point p1 = new Point( chart1.getAxes().getBottom().calcXPosValue(5),
                              chart1.getAxes().getLeft().calcYPosValue(
                              chart1.getAxes().getLeft().getMinimum()+
                              (chart1.getAxes().getLeft().getMaximum()
                              -chart1.getAxes().getLeft().getMinimum())/2.0));

        //annotation fixed to halfway up left axis .. value 5 on x axis

        tool1.setLeft(p1.x);
        tool1.setTop(p1.y);
    }
});
The above code will fix the annotation's position no matter where it is plotted. The above could also be written to associate with a Series Data point via the Series CalcXPos, CalcYPos.

It may be that the interim fix we'll need to deliver for annotation positioning on printing is to guarantee position for non-custom positioned annotations but to allow custom, axis scale related positioning (as above) to remain variable and overridable.

Regards,
Marc
Steema Support

Turc
Newbie
Newbie
Posts: 34
Joined: Wed Feb 03, 2010 12:00 am

Re: Print issues with graph and annotation

Post by Turc » Mon Oct 18, 2010 3:31 pm

Thank marc.

Narcís
Site Admin
Site Admin
Posts: 14730
Joined: Mon Jun 09, 2003 4:00 am
Location: Banyoles, Catalonia
Contact:

Re: Print issues with graph and annotation

Post by Narcís » Mon Dec 13, 2010 2:08 pm

Hi Turc,

A maintenance release fixing this issue has just been posted.
Best Regards,
Narcís Calvet / Development & Support
Steema Software
Avinguda Montilivi 33, 17003 Girona, Catalonia
Tel: 34 972 218 797
http://www.steema.com
Image Image Image Image Image Image
Instructions - How to post in this forum

Post Reply