html/scripts/RGraph/RGraph.common.resizing.js
function (e)
            {
                if (!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown) {
                    return;
                }

                if (RGraph.Resizing.div) {

                    var div    = RGraph.Resizing.div;
                    var canvas = div.__canvas__;
                    var coords = RGraph.getCanvasXY(div.__canvas__);

                    var parentNode = canvas.parentNode;

                    if (canvas.style.position != 'absolute') {
                        // Create a DIV to go in the canvases place
                        var placeHolderDIV = document.createElement('DIV');
                            placeHolderDIV.style.width = RGraph.Resizing.originalw + 'px';
                            placeHolderDIV.style.height = RGraph.Resizing.originalh + 'px';
                            //placeHolderDIV.style.backgroundColor = 'red';
                            placeHolderDIV.style.display = 'inline-block'; // Added 5th Nov 2010
                            placeHolderDIV.style.position = canvas.style.position;
                            placeHolderDIV.style.left     = canvas.style.left;
                            placeHolderDIV.style.top      = canvas.style.top;
                            placeHolderDIV.style.cssFloat = canvas.style.cssFloat;

                        parentNode.insertBefore(placeHolderDIV, canvas);
                    }


                    // Now set the canvas to be positioned absolutely
                    canvas.style.backgroundColor = 'white';
                    canvas.style.position        = 'absolute';
                    canvas.style.border = '1px dashed gray';
                    canvas.style.left            = (RGraph.Resizing.originalCanvasX  - 1) + 'px';
                    canvas.style.top             = (RGraph.Resizing.originalCanvasY - 1) + 'px';


                    /**
                    * Set the dimensions of the canvas using the HTML attributes
                    */
                    canvas.width  = parseInt(div.style.width);
                    canvas.height = parseInt(div.style.height);


                    /**
                    * Because resizing the canvas resets any tranformation - the antialias fix needs to be reapplied.
                    */
                    canvas.getContext('2d').translate(0.5,0.5);


                    /**
                    * Reset the gradient parsing status by setting all of the color values back to their original
                    * values before Draw was first called
                    */
                    var objects = RGraph.ObjectRegistry.getObjectsByCanvasID(canvas.id);
                    for (var i=0,len=objects.length; i<len; i+=1) {
                        
                        RGraph.resetColorsToOriginalValues(objects[i]);
                        if (typeof objects[i].reset === 'function') {
                            objects[i].reset();
                        }
                    }
                    
                    
                    
                    
                    /**
                    * Kill the background cache
                    */
                    RGraph.cache = [];
                

                    /**
                    * Fire the onresize event
                    */
                    RGraph.FireCustomEvent(canvas.__object__, 'onresizebeforedraw');

                    RGraph.RedrawCanvas(canvas);
                    

                    // Get rid of transparent semi-opaque DIV
                    RGraph.Resizing.mousedown = false;
                    div.style.display = 'none';
                    document.body.removeChild(div);
                }

                /**
                * If there is zoom enabled in thumbnail mode, lose the zoom image
                */
                if (RGraph.Registry.Get('chart.zoomed.div') || RGraph.Registry.Get('chart.zoomed.img')) {
                    RGraph.Registry.Set('chart.zoomed.div', null);
                    RGraph.Registry.Set('chart.zoomed.img', null);
                }

                /**
                * Fire the onresize event
                */
                RGraph.FireCustomEvent(canvas.__object__, 'onresizeend');
            }
function (e)
            {
                if (!RGraph.Resizing || !RGraph.Resizing.div || !RGraph.Resizing.mousedown) {
                    return;
                }

                if (RGraph.Resizing.div) {

                    var div    = RGraph.Resizing.div;
                    var canvas = div.__canvas__;
                    var coords = RGraph.getCanvasXY(div.__canvas__);

                    var parentNode = canvas.parentNode;

                    if (canvas.style.position != 'absolute') {
                        // Create a DIV to go in the canvases place
                        var placeHolderDIV = document.createElement('DIV');
                            placeHolderDIV.style.width = RGraph.Resizing.originalw + 'px';
                            placeHolderDIV.style.height = RGraph.Resizing.originalh + 'px';
                            //placeHolderDIV.style.backgroundColor = 'red';
                            placeHolderDIV.style.display = 'inline-block'; // Added 5th Nov 2010
                            placeHolderDIV.style.position = canvas.style.position;
                            placeHolderDIV.style.left     = canvas.style.left;
                            placeHolderDIV.style.top      = canvas.style.top;
                            placeHolderDIV.style.cssFloat = canvas.style.cssFloat;

                        parentNode.insertBefore(placeHolderDIV, canvas);
                    }


                    // Now set the canvas to be positioned absolutely
                    canvas.style.backgroundColor = 'white';
                    canvas.style.position        = 'absolute';
                    canvas.style.border = '1px dashed gray';
                    canvas.style.left            = (RGraph.Resizing.originalCanvasX  - 1) + 'px';
                    canvas.style.top             = (RGraph.Resizing.originalCanvasY - 1) + 'px';


                    /**
                    * Set the dimensions of the canvas using the HTML attributes
                    */
                    canvas.width  = parseInt(div.style.width);
                    canvas.height = parseInt(div.style.height);


                    /**
                    * Because resizing the canvas resets any tranformation - the antialias fix needs to be reapplied.
                    */
                    canvas.getContext('2d').translate(0.5,0.5);


                    /**
                    * Reset the gradient parsing status by setting all of the color values back to their original
                    * values before Draw was first called
                    */
                    var objects = RGraph.ObjectRegistry.getObjectsByCanvasID(canvas.id);
                    for (var i=0,len=objects.length; i<len; i+=1) {
                        
                        RGraph.resetColorsToOriginalValues(objects[i]);
                        if (typeof objects[i].reset === 'function') {
                            objects[i].reset();
                        }
                    }
                    
                    
                    
                    
                    /**
                    * Kill the background cache
                    */
                    RGraph.cache = [];
                

                    /**
                    * Fire the onresize event
                    */
                    RGraph.FireCustomEvent(canvas.__object__, 'onresizebeforedraw');

                    RGraph.RedrawCanvas(canvas);
                    

                    // Get rid of transparent semi-opaque DIV
                    RGraph.Resizing.mousedown = false;
                    div.style.display = 'none';
                    document.body.removeChild(div);
                }

                /**
                * If there is zoom enabled in thumbnail mode, lose the zoom image
                */
                if (RGraph.Registry.Get('chart.zoomed.div') || RGraph.Registry.Get('chart.zoomed.img')) {
                    RGraph.Registry.Set('chart.zoomed.div', null);
                    RGraph.Registry.Set('chart.zoomed.img', null);
                }

                /**
                * Fire the onresize event
                */
                RGraph.FireCustomEvent(canvas.__object__, 'onresizeend');
            }
function ( e ) { if ( ! RGraph . Resizing || ! RGraph . Resizing . div || ! RGraph . Resizing . mousedown ) { return ; } if ( RGraph . Resizing . div ) { var div = RGraph . Resizing . div ; var canvas = div . __canvas__ ; var coords = RGraph . getCanvasXY ( div . __canvas__ ) ; var parentNode = canvas . parentNode ; if ( canvas . style . position != 'absolute' ) { // Create a DIV to go in the canvases place var placeHolderDIV = document . createElement ( 'DIV' ) ; placeHolderDIV . style . width = RGraph . Resizing . originalw + 'px' ; placeHolderDIV . style . height = RGraph . Resizing . originalh + 'px' ; //placeHolderDIV.style.backgroundColor = 'red'; placeHolderDIV . style . display = 'inline-block' ; // Added 5th Nov 2010 placeHolderDIV . style . position = canvas . style . position ; placeHolderDIV . style . left = canvas . style . left ; placeHolderDIV . style . top = canvas . style . top ; placeHolderDIV . style . cssFloat = canvas . style . cssFloat ; parentNode . insertBefore ( placeHolderDIV , canvas ) ; } // Now set the canvas to be positioned absolutely canvas . style . backgroundColor = 'white' ; canvas . style . position = 'absolute' ; canvas . style . border = '1px dashed gray' ; canvas . style . left = ( RGraph . Resizing . originalCanvasX - 1 ) + 'px' ; canvas . style . top = ( RGraph . Resizing . originalCanvasY - 1 ) + 'px' ; /**
                    * Set the dimensions of the canvas using the HTML attributes
                    */ canvas . width = parseInt ( div . style . width ) ; canvas . height = parseInt ( div . style . height ) ; /**
                    * Because resizing the canvas resets any tranformation - the antialias fix needs to be reapplied.
                    */ canvas . getContext ( '2d' ) . translate ( 0.5 , 0.5 ) ; /**
                    * Reset the gradient parsing status by setting all of the color values back to their original
                    * values before Draw was first called
                    */ var objects = RGraph . ObjectRegistry . getObjectsByCanvasID ( canvas . id ) ; for ( var i = 0 , len = objects . length ; i < len ; i += 1 ) { RGraph . resetColorsToOriginalValues ( objects [ i ] ) ; if ( typeof objects [ i ] . reset === 'function' ) { objects [ i ] . reset ( ) ; } } /**
                    * Kill the background cache
                    */ RGraph . cache = [ ] ; /**
                    * Fire the onresize event
                    */ RGraph . FireCustomEvent ( canvas . __object__ , 'onresizebeforedraw' ) ; RGraph . RedrawCanvas ( canvas ) ; // Get rid of transparent semi-opaque DIV RGraph . Resizing . mousedown = false ; div . style . display = 'none' ; document . body . removeChild ( div ) ; } /**
                * If there is zoom enabled in thumbnail mode, lose the zoom image
                */ if ( RGraph . Registry . Get ( 'chart.zoomed.div' ) || RGraph . Registry . Get ( 'chart.zoomed.img' ) ) { RGraph . Registry . Set ( 'chart.zoomed.div' , null ) ; RGraph . Registry . Set ( 'chart.zoomed.img' , null ) ; } /**
                * Fire the onresize event
                */ RGraph . FireCustomEvent ( canvas . __object__ , 'onresizeend' ) ; }
The window onmouseup function
The window onmouseup function