Changeset 54

Show
Ignore:
Timestamp:
10/08/06 09:38:53 (2 years ago)
Author:
al
Message:

fixed bar chart redraw with 2 x values only

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • plotkit/trunk/PlotKit/Canvas.js

    r38 r54  
    555555    var connect = MochiKit.Signal.connect; 
    556556    var bind = MochiKit.Base.bind; 
    557     MochiKit.Signal.registerSignals(this, ['onmouseover', 'onclick', 'onmouseout', 'onmousemove']); 
     557    //MochiKit.Signal.registerSignals(this, ['onmouseover', 'onclick', 'onmouseout', 'onmousemove']); 
    558558    //connect(this.element, 'onmouseover', bind(this.onmouseover, this)); 
    559559    //connect(this.element, 'onmouseout', bind(this.onmouseout, this)); 
  • plotkit/trunk/PlotKit/Layout.js

    r52 r54  
    361361    else { 
    362362        // readjust xscale to fix with bar charts 
    363         this.xscale = (1.0 - xdelta/this.xrange)/this.xrange; 
     363        if (this.xrange == 1) { 
     364            this.xscale = 0.5; 
     365        } 
     366        else if (this.xrange == 2) { 
     367            this.xscale = 1/3.0; 
     368        } 
     369        else { 
     370            this.xscale = (1.0 - xdelta/this.xrange)/this.xrange; 
     371        } 
    364372        barWidth = xdelta * this.xscale * this.options.barWidthFillFraction; 
    365373        barWidthForSet = barWidth / setCount; 
  • plotkit/trunk/PlotKit/PlotKit_Packed.js

    r52 r54  
    485485_92=(1-this.options.barWidthFillFraction)/2; 
    486486}else{ 
     487if(this.xrange==1){ 
     488this.xscale=0.5; 
     489}else{ 
     490if(this.xrange==2){ 
     491this.xscale=1/3; 
     492}else{ 
    487493this.xscale=(1-_88/this.xrange)/this.xrange; 
     494} 
     495} 
    488496_90=_88*this.xscale*this.options.barWidthFillFraction; 
    489497_91=_90/_87; 
     
    11641172var _221=MochiKit.Signal.connect; 
    11651173var bind=MochiKit.Base.bind; 
    1166 MochiKit.Signal.registerSignals(this,["onmouseover","onclick","onmouseout","onmousemove"]); 
    11671174_221(this.element,"onclick",bind(this.onclick,this)); 
    11681175}; 
  • plotkit/trunk/doc/PlotKit.html

    r53 r54  
    185185     Fixed xTicks drawing that exceed the bounds of the chart (thanks to 
    186186     Cliff) 
     187 </li> 
     188 
     189 <li> 
     190     Fixed barchart drawing with only 2 values (thanks to HubrisSonic) 
    187191 </li> 
    188192</ul> 
  • plotkit/trunk/doc/PlotKit.txt

    r53 r54  
    8686* Fixed xTicks drawing that exceed the bounds of the chart (thanks to 
    8787    Cliff) 
     88* Fixed barchart drawing with only 2 values (thanks to HubrisSonic) 
    8889 
    8990###PlotKit 0.8