|
XYChart auto size question... |
Posted by SeungHo Moon on Mar-14-2012 12:18 |
|
I will intend to change size of the chart in size of windows automatically. I mean the chart suits to windows size, not fix.
And then, when user try to change the size of windows, it has to be changed at same time.
Any method is there? I need your help.
I am looking forward to seeing your reply.
Thanks ahead
Regards.
Moon. |
Re: XYChart auto size question... |
Posted by Peter Kwan on Mar-15-2012 01:00 |
|
Hi SeungHo,
The solution is to simply redraw the chart to fit the windows size.
The charting subroutine should be designed to draw the chart using a variable size. When the windows resize, in the resize event handler, you can call the charting subroutine with the new width and height as parameter to redraw the chart.
Hope this can help.
Regards
Peter Kwan |
Re: XYChart auto size question... |
Posted by SeungHo Moon on Mar-15-2012 08:13 |
|
Thank you. Thanks to have solved the problem.
And sorry, but that, hour of the window size increases the size of the chart, increasing the speed seems a little late.
Do you have ways to resolve this issue? |
Re: XYChart auto size question... |
Posted by Peter Kwan on Mar-16-2012 00:53 |
|
Hi SeungHo,
For a desktop application, updating a typical XY chart can take from 50ms to 200ms (depending on the size of the chart). So it may not update as fast as the Windows resize, but may have some lag.
In some GUI frameworks, when the Windows is resized by mouse drag, the framework may trigger a large number of resize events quickly. In this case, it may be possible to combine multiple resize event into a single event, to reduce the number of redrawing necessarily. One method is to use updateViewPort to trigger a ViewPortChanged event in the resize event handler, and then redraw the chart in the ViewPortChanged event handler. The WinChartViewer (or ChartViewer or CChartViewer or QChartViewer, depending on your programming langauge) can combine multiple ViewPortChanged events into one event (see UpdateInterval or setUpdateInterval - you may look it up from the ChartDirector documentation index), this can reduce the number of redrawings required.
Regards
Peter Kwan |
|