Changeset 38

Show
Ignore:
Timestamp:
14/06/06 16:26:12 (2 years ago)
Author:
al
Message:

Do not cache layout style to renderer, updated Packed, added dynamic table demo

Files:

Legend:

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

    r32 r38  
    8888 
    8989    this.layout = layout; 
    90     this.style = layout.style; 
    91     this.element = element; 
     90    this.element = MochiKit.DOM.getElement(element); 
    9291    this.container = this.element.parentNode; 
    9392 
     
    167166        this._renderBackground(); 
    168167 
    169     if (this.style == "bar") { 
     168    if (this.layout.style == "bar") { 
    170169        this._renderBarChart(); 
    171170                this._renderBarAxis();  
    172171        } 
    173     else if (this.style == "pie") { 
     172    else if (this.layout.style == "pie") { 
    174173        this._renderPieChart(); 
    175174                this._renderPieAxis(); 
    176175        } 
    177     else if (this.style == "line") { 
     176    else if (this.layout.style == "line") { 
    178177        this._renderLineChart(); 
    179178                this._renderLineAxis(); 
  • plotkit/trunk/PlotKit/PlotKit_Packed.js

    r36 r38  
    757757MochiKit.Base.update(this.options,_161?_161:{}); 
    758758this.layout=_160; 
    759 this.style=_160.style; 
    760 this.element=_159; 
     759this.element=MochiKit.DOM.getElement(_159); 
    761760this.container=this.element.parentNode; 
    762761this.isIE=PlotKit.Base.excanvasSupported(); 
     
    814813this._renderBackground(); 
    815814} 
    816 if(this.style=="bar"){ 
     815if(this.layout.style=="bar"){ 
    817816this._renderBarChart(); 
    818817this._renderBarAxis(); 
    819818}else{ 
    820 if(this.style=="pie"){ 
     819if(this.layout.style=="pie"){ 
    821820this._renderPieChart(); 
    822821this._renderPieAxis(); 
    823822}else{ 
    824 if(this.style=="line"){ 
     823if(this.layout.style=="line"){ 
    825824this._renderLineChart(); 
    826825this._renderLineAxis(); 
     
    12521251MochiKit.Base.update(this.options,_243?_243:{}); 
    12531252this.layout=_242; 
    1254 this.style=_242.style; 
    12551253this.element=MochiKit.DOM.getElement(_241); 
    12561254this.container=this.element.parentNode; 
     
    12821280this._renderBackground(); 
    12831281} 
    1284 if(this.style=="bar"){ 
     1282if(this.layout.style=="bar"){ 
    12851283this._renderBarChart(); 
    12861284this._renderBarAxis(); 
    12871285}else{ 
    1288 if(this.style=="pie"){ 
     1286if(this.layout.style=="pie"){ 
    12891287this._renderPieChart(); 
    12901288this._renderPieAxis(); 
    12911289}else{ 
    1292 if(this.style=="line"){ 
     1290if(this.layout.style=="line"){ 
    12931291this._renderLineChart(); 
    12941292this._renderLineAxis(); 
     
    17621760bind(_348,this)(_340); 
    17631761_340.fill(); 
    1764 } 
    17651762_340.restore(); 
     1763} 
    17661764_340.shadowBlur=5; 
    17671765_340.shadowColor=Color.fromHexString("#888888").toRGBString(); 
  • plotkit/trunk/PlotKit/SVG.js

    r25 r38  
    8383    MochiKit.Base.update(this.options, options ? options : {}); 
    8484    this.layout = layout; 
    85     this.style = layout.style; 
    8685    this.element = MochiKit.DOM.getElement(element); 
    8786    this.container = this.element.parentNode; 
     
    133132        this._renderBackground(); 
    134133 
    135     if (this.style == "bar") { 
     134    if (this.layout.style == "bar") { 
    136135        this._renderBarChart(); 
    137136        this._renderBarAxis(); 
    138137    } 
    139     else if (this.style == "pie") { 
     138    else if (this.layout.style == "pie") { 
    140139        this._renderPieChart(); 
    141140        this._renderPieAxis(); 
    142141    } 
    143     else if (this.style == "line") { 
     142    else if (this.layout.style == "line") { 
    144143        this._renderLineChart(); 
    145144        this._renderLineAxis(); 
  • plotkit/trunk/tests/quickstart.html

    r29 r38  
    4242     
    4343    <script type="text/javascript"> 
    44         var layout = new Layout("bar"); 
     44        var layout = new Layout("line"); 
    4545        layout.addDatasetFromTable("dataset2", $("values"), xcol = 0, ycol = 2);         
    4646        layout.addDatasetFromTable("dataset1", $("values"), xcol = 0, ycol = 1);