Page 1 of 1

Print issues with graph and annotation

Posted: Mon Aug 30, 2010 6:25 pm
by 15355183
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

Re: Print issues with graph and annotation

Posted: Mon Aug 30, 2010 6:28 pm
by 15355183
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);

Re: Print issues with graph and annotation

Posted: Mon Aug 30, 2010 7:29 pm
by 15355183
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.

Re: Print issues with graph and annotation

Posted: Thu Sep 02, 2010 8:42 am
by yeray
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 1135 times
Could you modify it so we can reproduce the problem here?

Re: Print issues with graph and annotation

Posted: Mon Oct 04, 2010 2:14 pm
by 15355183
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"?

Re: Print issues with graph and annotation

Posted: Fri Oct 08, 2010 9:11 am
by Marc
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

Re: Print issues with graph and annotation

Posted: Wed Oct 13, 2010 1:17 pm
by Marc
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

Re: Print issues with graph and annotation

Posted: Wed Oct 13, 2010 10:09 pm
by 15355183
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?

Re: Print issues with graph and annotation

Posted: Fri Oct 15, 2010 4:37 pm
by Marc
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

Re: Print issues with graph and annotation

Posted: Mon Oct 18, 2010 3:31 pm
by 15355183
Thank marc.

Re: Print issues with graph and annotation

Posted: Mon Dec 13, 2010 2:08 pm
by narcis
Hi Turc,

A maintenance release fixing this issue has just been posted.