%PDF-1.5 %���� ºaâÚÎΞ-ÌE1ÍØÄ÷{òò2ÿ ÛÖ^ÔÀá TÎ{¦?§®¥kuµùÕ5sLOšuY
Server IP : 49.231.201.246 / Your IP : 216.73.216.41 Web Server : Apache/2.4.18 (Ubuntu) System : Linux 246 4.4.0-210-generic #242-Ubuntu SMP Fri Apr 16 09:57:56 UTC 2021 x86_64 User : root ( 0) PHP Version : 7.0.33-0ubuntu0.16.04.16 Disable Function : exec,passthru,shell_exec,system,proc_open,popen,pcntl_exec MySQL : OFF | cURL : ON | WGET : ON | Perl : ON | Python : ON | Sudo : ON | Pkexec : ON Directory : /var/www/html/ppaobm/backend/web/adminlte/bower_components/morris.js/spec/lib/bar/ |
Upload File : |
describe 'Morris.Bar#colorFor', -> defaults = element: 'graph' data: [{x: 'foo', y: 2, z: 3}, {x: 'bar', y: 4, z: 6}] xkey: 'x' ykeys: ['y', 'z'] labels: ['Y', 'Z'] it 'should fetch colours from an array', -> chart = Morris.Bar $.extend {}, defaults, barColors: ['#f00', '#0f0', '#00f'] chart.colorFor(chart.data[0], 0, 'bar').should.equal '#f00' chart.colorFor(chart.data[0], 0, 'hover').should.equal '#f00' chart.colorFor(chart.data[0], 1, 'bar').should.equal '#0f0' chart.colorFor(chart.data[0], 1, 'hover').should.equal '#0f0' chart.colorFor(chart.data[0], 2, 'bar').should.equal '#00f' chart.colorFor(chart.data[0], 2, 'hover').should.equal '#00f' chart.colorFor(chart.data[0], 3, 'bar').should.equal '#f00' chart.colorFor(chart.data[0], 4, 'hover').should.equal '#0f0' it 'should defer to a callback', -> stub = sinon.stub().returns '#f00' chart = Morris.Bar $.extend {}, defaults, barColors: stub stub.reset() chart.colorFor(chart.data[0], 0, 'bar') stub.should.have.been.calledWith( {x:0, y:2, label:'foo'}, {index:0, key:'y', label:'Y'}, 'bar') chart.colorFor(chart.data[0], 1, 'hover') stub.should.have.been.calledWith( {x:0, y:3, label:'foo'}, {index:1, key:'z', label:'Z'}, 'hover')