ASE Home Page Products Download Purchase Support About ASE
ChartDirector Support
Forum HomeForum Home   SearchSearch

Message ListMessage List     Post MessagePost Message

  Clone Chart In Separate Window
Posted by Steve on Jul-15-2013 13:26
Peter,

I would like to have a separate window (VB6 / COM btw) showing the same chart as that displaying on my 'main' chart viewer but with a different size. The idea being that the user can view the chart in a new, separate window and not have the rest of the UI controls on it, cluttering it up - so that they can (primarily) view the chart full-screen in the new window.

I have achieved the 'cloning' by having the two chartviewer OCX controls and passing a reference to the financechart object. Only problem with this is that the main chart has already been added on that object reference at a certain size - and therefore that is the size of the chart in the 'new window' as it were.

I was trying to avoid the overhead of having to 'draw the chart again' as that is just a duplication of effort really. I just need a chart image of the main one but resizable (and the image updates when the 'main' chart updates).

I realize that there are options for setting the picture of the second viewer to that of the first etc but that is at the same dimensions. What would be the best way of doing this without having to redraw 'from scratch' as it were or is that the only way ?

Thanks in advance,

Steve.

  Re: Clone Chart In Separate Window
Posted by Peter Kwan on Jul-16-2013 00:50
Hi Steve,

For your case, I think redrawing the chart is the best way.

Note that redrawing the chart may be simplier than cloning the chart. The charting code has already been written for drawing the orignal chart. You just need to put it into a subroutine and calls the subroutine again, passing in different parameters (different ChartViewer object and size).

In most applications, "resizing a chart" means to plot a chart in greater detail. For example, a "thumb nail" chart may contain just a few labels, but a big chart may contain more labels and grid lines to show finer details. So resizing is really a complete redraw of the chart. If you look at the charts in the Microsoft task manager and performance manager (enter "perfmon" from the command line), you can see the charts are redrawn then they are resized (eg. the number of grid lines and labels are different, but the font size and line widths are the same).

Regards
Peter Kwan