Changeset 43

Show
Ignore:
Timestamp:
06/07/06 10:04:23 (2 years ago)
Author:
al
Message:

SweetCanvas? respects shouldStroke

Files:

Legend:

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

    r38 r43  
    17151715_331(_339,x,y,w,h); 
    17161716} 
     1717if(this.options.shouldFill){ 
    17171718_339.fillStyle=_337(bar.name).toRGBString(); 
    17181719_339.fillRect(x,y,w,h); 
     1720} 
    17191721_339.shadowBlur=0; 
    17201722_339.strokeStyle=Color.whiteColor().toRGBString(); 
    17211723_339.lineWidth=2; 
     1724if(this.options.shouldStroke){ 
    17221725_339.strokeRect(x,y,w,h); 
     1726} 
    17231727_339.restore(); 
    17241728}; 
     
    17591763_340.translate(-1,-2); 
    17601764bind(_348,this)(_340); 
     1765if(this.options.shouldFill){ 
    17611766_340.fill(); 
     1767} 
    17621768_340.restore(); 
    17631769} 
     
    18181824}; 
    18191825if(Math.abs(_353[i].startAngle-_353[i].endAngle)>0.0001){ 
     1826if(this.options.shouldFill){ 
    18201827_359(); 
    18211828_351.fill(); 
     1829} 
     1830if(this.options.shouldStroke){ 
    18221831_359(); 
    18231832_351.stroke(); 
     1833} 
    18241834} 
    18251835} 
  • plotkit/trunk/PlotKit/SweetCanvas.js

    r42 r43  
    124124        context.strokeStyle = Color.whiteColor().toRGBString(); 
    125125        context.lineWidth = 2.0; 
    126  
    127         context.strokeRect(x, y, w, h);                 
     126         
     127        if (this.options.shouldStroke) { 
     128            context.strokeRect(x, y, w, h);                 
     129        } 
    128130 
    129131        context.restore(); 
     
    259261                context.fill(); 
    260262            } 
    261             makePath(); 
    262             context.stroke(); 
     263            if (this.options.shouldStroke) { 
     264                makePath(); 
     265                context.stroke(); 
     266            } 
    263267        } 
    264268    } 
  • plotkit/trunk/tests/debug.html

    r42 r43  
    2525     
    2626    <script type="text/javascript"> 
    27         var optionsPKChart1373 = officeRed(); 
    28         MochiKit.Base.update(optionsPKChart1373, {padding:{left: 90, right:20, top: 10, bottom: 10}, barOrientation:'horizontal',xTicks:[{label:'boundary0',v:0},{label:'boundary1',v:1},{label:'boundary2',v:2},{label:'cellBarred',v:3},{label:'powerControlIndicator',v:4},{label:'thresholdCCCHLoadIndication',v:5},{label:'uRxLevDLP',v:6},{label:'boundary3',v:7},{label:'egprsServices',v:8},{label:'lRxLevULP',v:9}]}); 
    29         var layoutPKChart1373 = new PlotKit.Layout('bar', optionsPKChart1373); 
    30         layoutPKChart1373.addDataset('UP_NY', [[0,90.0], [1,90.0], [2,90.0], [3,1896.0], [4,1896.0], [5,1896.0], [6,4.0], [7,90.0], [8,1218.0], [9, 222.0]]); 
    31         layoutPKChart1373.addDataset('PHILADELPHIA', [[0,1781.0], [1,1781.0], [2,1781.0], [3,1781.0], [4,1781.0], [5,1781.0], [6,4.0], [7,1781.0], [8,1299.0], [9,838.0]]); 
    32         layoutPKChart1373.addDataset('NEW_JERSEY', [[0, 6553.0], [1,6553.0], [2,6553.0], [3,6553.0], [4,6553.0], [5,6553.0], [6,6553.0], [7,6553.0], [8,6165.0], [9,6144.0]]); 
    33         layoutPKChart1373.addDataset('CONNECTICUT', [[0,1113.0], [1,1113.0], [2,1113.0], [3,1113.0], [4, 1113.0], [5,1113.0], [6,1113.0], [7,1113.0], [8,600.0], [9,820.0]]); 
    34         layoutPKChart1373.evaluate(); 
    35         var canvasPKChart1373 = MochiKit.DOM.getElement('chart'); 
    36         var plotterPKChart1373 = new PlotKit.SweetCanvasRenderer (canvasPKChart1373, layoutPKChart1373, optionsPKChart1373); 
    37         plotterPKChart1373.render(); 
     27    var options = { 
     28       "colorScheme": PlotKit.Base.palette(PlotKit.Base.baseColors()[5]), 
     29       "padding": {left: 20, right: 0, top: 10, bottom: 30}, 
     30 
     31       "xTicks": [{v:0, label:"Jan"},  
     32              {v:1, label:"Feb"},  
     33              {v:2, label:"Mar"}, 
     34              {v:3, label:"Apr"}, 
     35              {v:4, label:"May"}] 
     36    }; 
     37 
     38    function drawGraph() { 
     39        var layout = new PlotKit.Layout("bar", options); 
     40        layout.addDataset("bar1", [[0, 5], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); 
     41        layout.addDataset("bar2", [[0, 3], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); 
     42        layout.addDataset("bar3", [[0, 2], [1, 1], [2, 1.414], [3, 1.73], [4, 2]]); 
     43        layout.evaluate(); 
     44        var canvas = MochiKit.DOM.getElement("chart"); 
     45        var plotter = new PlotKit.SweetCanvasRenderer(canvas, layout, options); 
     46        plotter.render(); 
     47    } 
     48    MochiKit.DOM.addLoadEvent(drawGraph); 
    3849 
    3950    </script> 
  • plotkit/trunk/tests/sweet.js

    r10 r43  
    22 
    33var opts = { 
    4     "IECanvasHTC": "../plotkit/iecanvas.htc", 
    54    "enableEvents": false 
    65};