Page 1 of 1

Saving hidden charts

Posted: Thu May 26, 2005 5:34 am
by 8578785
When the user saves a chart to a metafile, we want the chart form to be maximized, otherwise the image scale is bad.

To avoid flicker, we save the state of the form, then:

Visible = false;
WindowState = wsMaximized;

Chart1->SaveToMetafileEnh(filename);

then restore the form to user's size and make visible

Howeve, the chart is not maximized when hidden. We can get this work if we maximize without hiding the chart, but we don't want the flicker of maximizing and restoring the chart while it's visible.

We also need the generic ability to create and save charts (as metafiles) that are not displayed on the screen.

Help?

Kevin

Posted: Thu Jun 16, 2005 8:43 am
by Pep
Hi Kevin,

how about increasing the size of the Chart manually before do the Export ?

Posted: Thu Jun 16, 2005 10:41 pm
by 9340553
That doesn't help. We want this to be automatic without user actions. For example, we need a "save all charts to file" function that requires no user actions, and doesn't flash dozens of charts on the screen.

The underlying problem is TChart's implementation of custom items, which derive their properties from screen dimensions and do not function correctly if the chart->Visible = false. Our charts have custom axes and custom-positioned annotations.

We do not understand why Steema implemented "custom" items differently than "normal" items, especially in an OOP environment. This seems to be a continuous problem for users.

We have a work-around that is crude, but successful.