Changeset 19850
- Timestamp:
- 12/01/15 22:54:24 (9 years ago)
- File:
-
- 1 edited
Legend:
- Unmodified
- Added
- Removed
-
issm/trunk-jpl/src/m/plot/applyoptions.js
r19849 r19850 147 147 ccanvas=document.getElementById(ccanvasid); 148 148 if(ccanvas==null){ 149 ccanvas = $('<canvas id="'+ccanvasid+' width="'+String(cwidth*4)+'" height="'+String(cheight+cheightoffset)+'"></canvas>').insertAfter('#'+options.getfieldvalue('canvasid'));150 ccanvas.css({' display':'inline-block','position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'});149 ccanvas = $('<canvas id="'+ccanvasid+'" width="'+String(cwidth+cheightoffset*4)+'" height="'+String(cheight+cheightoffset)+'"></canvas>').insertAfter('#'+options.getfieldvalue('canvasid')); 150 ccanvas.css({'position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'}); 151 151 ccontext = ccanvas[0].getContext('2d'); 152 152 } … … 154 154 ccanvas = $('#'+ccanvasid); 155 155 if (options.exist('colorbarcanvasid')){ 156 //store actual colobar size 156 157 cheight=ccanvas.height(); 157 cwidth=ccanvas.width(); 158 cwidth=ccanvas.width(); 159 //get html object instead of jqurey object to modify height/width to accomodate labels 160 document.getElementById(ccanvasid).width=ccanvas.width()+cheightoffset*6; 161 document.getElementById(ccanvasid).width=ccanvas.height()+cheightoffset; 158 162 } 159 ccanvas.css({'display':'inline-block','position':'relative','top':((canvassize-cheight-cheightoffset)/-2).toFixed(2)+'px'});160 163 ccontext = ccanvas[0].getContext('2d'); 161 164 /*erase existing colorbar:*/
Note:
See TracChangeset
for help on using the changeset viewer.