Subversion Repositories wimsdev

Rev

Rev 7738 | Rev 7746 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 7738 Rev 7739
Line 2518... Line 2518...
2518
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2518
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2519
         @ ymajor is the major step on the y-axis; yminor is the divisor for the y-step
2519
         @ ymajor is the major step on the y-axis; yminor is the divisor for the y-step
2520
         @ the linewidth is set using command 'linewidth int'
2520
         @ the linewidth is set using command 'linewidth int'
2521
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2521
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2522
         @ default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number'
2522
         @ default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number'
2523
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li></ul>
2523
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
2524
         @ note: the complete canvas will be used for the 'log paper'
2524
         @ note: the complete canvas will be used for the 'log paper'
2525
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2525
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2526
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2526
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2527
         @ note: when using something like 'xrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2527
         @ note: when using something like 'xrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2528
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
2528
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
Line 2534... Line 2534...
2534
                switch(i){
2534
                switch(i){
2535
                    case 0: double_data[0] = get_real(infile,0);break; /* xmajor */
2535
                    case 0: double_data[0] = get_real(infile,0);break; /* xmajor */
2536
                    case 1: int_data[0] = (int) (get_real(infile,0));break; /* xminor */
2536
                    case 1: int_data[0] = (int) (get_real(infile,0));break; /* xminor */
2537
                    case 2: stroke_color = get_color(infile,0); break;
2537
                    case 2: stroke_color = get_color(infile,0); break;
2538
                    case 3: fill_color = get_color(infile,1);
2538
                    case 3: fill_color = get_color(infile,1);
2539
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering,double_data[0],int_data[0]);
2539
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering,double_data[0],int_data[0]);
2540
                        tmp_buffer = my_newmem(string_length+1);
2540
                        tmp_buffer = my_newmem(string_length+1);
2541
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering,double_data[0],int_data[0]);
2541
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering,double_data[0],int_data[0]);
2542
                        fprintf(js_include_file,"use_xlogscale=1;snap_y = %f;snap_x = xlogbase;",double_data[0]/int_data[0]);
2542
                        fprintf(js_include_file,"use_xlogscale=1;snap_y = %f;snap_x = xlogbase;",double_data[0]/int_data[0]);
2543
                        add_to_buffer(tmp_buffer);
2543
                        add_to_buffer(tmp_buffer);
2544
                        break;
2544
                        break;
2545
                    default:break;
2545
                    default:break;
2546
                }
2546
                }
Line 2552... Line 2552...
2552
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2552
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2553
         @ xmajor is the major step on the x-axis; xminor is the divisor for the x-step
2553
         @ xmajor is the major step on the x-axis; xminor is the divisor for the x-step
2554
         @ the linewidth is set using command 'linewidth int'
2554
         @ the linewidth is set using command 'linewidth int'
2555
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2555
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2556
         @ default logbase number = 10 ... when needed , set the logbase number with command 'ylogbase number'
2556
         @ default logbase number = 10 ... when needed , set the logbase number with command 'ylogbase number'
2557
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li></ul>
2557
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
2558
         @ note: the complete canvas will be used for the 'log paper'
2558
         @ note: the complete canvas will be used for the 'log paper'
2559
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2559
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2560
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2560
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2561
         @ note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2561
         @ note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2562
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
2562
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
Line 2568... Line 2568...
2568
                switch(i){
2568
                switch(i){
2569
                    case 0: double_data[0] = get_real(infile,0);break; /* xmajor */
2569
                    case 0: double_data[0] = get_real(infile,0);break; /* xmajor */
2570
                    case 1: int_data[0] = (int) (get_real(infile,0));break; /* xminor */
2570
                    case 1: int_data[0] = (int) (get_real(infile,0));break; /* xminor */
2571
                    case 2: stroke_color = get_color(infile,0); break;
2571
                    case 2: stroke_color = get_color(infile,0); break;
2572
                    case 3: fill_color = get_color(infile,1);
2572
                    case 3: fill_color = get_color(infile,1);
2573
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering,double_data[0],int_data[0]);
2573
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering,double_data[0],int_data[0]);
2574
                        tmp_buffer = my_newmem(string_length+1);
2574
                        tmp_buffer = my_newmem(string_length+1);
2575
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering,double_data[0],int_data[0]);
2575
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d,%f,%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering,double_data[0],int_data[0]);
2576
                        fprintf(js_include_file,"use_ylogscale=1;snap_x = %f;snap_y = ylogbase;",double_data[0]/int_data[0]);
2576
                        fprintf(js_include_file,"use_ylogscale=1;snap_x = %f;snap_y = ylogbase;",double_data[0]/int_data[0]);
2577
                        add_to_buffer(tmp_buffer);
2577
                        add_to_buffer(tmp_buffer);
2578
                        break;
2578
                        break;
2579
                    default:break;
2579
                    default:break;
2580
                }
2580
                }
Line 2585... Line 2585...
2585
         @ xylogscale majorcolor,minorcolor
2585
         @ xylogscale majorcolor,minorcolor
2586
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2586
         @ the x/y-range are set using commands 'xrange xmin,xmax' and 'yrange ymin,ymax'
2587
         @ the linewidth is set using command 'linewidth int'
2587
         @ the linewidth is set using command 'linewidth int'
2588
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2588
         @ the opacity of major / minor grid lines is set by command 'opacity [0-255],[0-255]'
2589
         @ default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number' and/or 'ylogbase number'
2589
         @ default logbase number = 10 ... when needed , set the logbase number with command 'xlogbase number' and/or 'ylogbase number'
2590
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li></ul>
2590
         @ the x/y- axis numbering is triggered by keyword 'axisnumbering'<ul><li>use commands 'xlabel some_text' and/or 'ylabel some_text' for text on axis : use command 'fontsize int' to set the fontsize (default 12px)</li><li>use command 'fontfamily fnt_family_string' to set the fonts for axis-numbering</li><li>use command'fontcolor' to set the colour</li></ul>
2591
         @ note: the complete canvas will be used for the 'log paper'
2591
         @ note: the complete canvas will be used for the 'log paper'
2592
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2592
         @ note: userdrawings are done in the log paper, e.g. javascript:read_canvas() will return the real values
2593
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2593
         @ note: command 'mouse color,fontsize' will show the real values in the logpaper.<br />\
2594
         @ note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2594
         @ note: when using something like 'yrange 0.0001,0.01'...combined with commands 'mouse color,fontsize' and/or 'userdraw type,color'...<br /> make sure the precision is set accordingly (eg command 'precision 10000')  
2595
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
2595
         @ note: in case of userdraw , the use of keyword 'userinput_xy' may be handy !
Line 2599... Line 2599...
2599
            if( js_function[DRAW_XYLOGSCALE] != 1 ){ js_function[DRAW_XYLOGSCALE] = 1;}
2599
            if( js_function[DRAW_XYLOGSCALE] != 1 ){ js_function[DRAW_XYLOGSCALE] = 1;}
2600
            for(i=0;i<2;i++){
2600
            for(i=0;i<2;i++){
2601
                switch(i){
2601
                switch(i){
2602
                    case 0: stroke_color = get_color(infile,0); break;
2602
                    case 0: stroke_color = get_color(infile,0); break;
2603
                    case 1: fill_color = get_color(infile,1);
2603
                    case 1: fill_color = get_color(infile,1);
2604
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering);
2604
                        string_length = snprintf(NULL,0,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering);
2605
                        tmp_buffer = my_newmem(string_length+1);
2605
                        tmp_buffer = my_newmem(string_length+1);
2606
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,use_axis_numbering);
2606
                        snprintf(tmp_buffer,string_length,"draw_grid%d(%d,%d,\"%s\",\"%s\",%.2f,%.2f,%d,\"%s\",\"%s\",%d); ",canvas_root_id,GRID_CANVAS,line_width,stroke_color,fill_color,stroke_opacity,fill_opacity,font_size,font_family,font_color,use_axis_numbering);
2607
                        fprintf(js_include_file,"use_xlogscale=1;use_ylogscale=1;snap_x = xlogbase;snap_y = ylogbase;");
2607
                        fprintf(js_include_file,"use_xlogscale=1;use_ylogscale=1;snap_x = xlogbase;snap_y = ylogbase;");
2608
                        add_to_buffer(tmp_buffer);
2608
                        add_to_buffer(tmp_buffer);
2609
                        break;
2609
                        break;
2610
                    default:break;
2610
                    default:break;
2611
                }
2611
                }
Line 5530... Line 5530...
5530
 return;\
5530
 return;\
5531
};",canvas_root_id,canvas_root_id,canvas_root_id);
5531
};",canvas_root_id,canvas_root_id,canvas_root_id);
5532
    break;
5532
    break;
5533
case DRAW_XYLOGSCALE:
5533
case DRAW_XYLOGSCALE:
5534
fprintf(js_include_file,"\n<!-- draw xylogscale -->\n\
5534
fprintf(js_include_file,"\n<!-- draw xylogscale -->\n\
5535
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,use_axis_numbering){\n\
5535
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,font_color,use_axis_numbering){\n\
5536
 var obj;\n\
5536
 var obj;\n\
5537
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5537
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5538
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5538
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5539
 }\n\
5539
 }\n\
5540
 else\n\
5540
 else\n\
Line 5542... Line 5542...
5542
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5542
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5543
 };\n\
5543
 };\n\
5544
 var ctx = obj.getContext(\"2d\");\n\
5544
 var ctx = obj.getContext(\"2d\");\n\
5545
 ctx.clearRect(0,0,xsize,ysize);\
5545
 ctx.clearRect(0,0,xsize,ysize);\
5546
 ctx.save();\n\
5546
 ctx.save();\n\
-
 
5547
 var xmarge;var ymarge;var x_e;var y_e;var num;var corr;var xtxt;var ytxt;\
-
 
5548
 var x_min = Math.log(xmin)/Math.log(xlogbase);\n\
-
 
5549
 var x_max = Math.log(xmax)/Math.log(xlogbase);\n\
-
 
5550
 var y_min = Math.log(ymin)/Math.log(ylogbase);\n\
-
 
5551
 var y_max = Math.log(ymax)/Math.log(ylogbase);\n\
-
 
5552
 if(use_axis_numbering == 1){\
-
 
5553
  ctx.font = font_family;\n\
-
 
5554
  xmarge = ctx.measureText(ylogbase+'^'+y_max.toFixed(0)+' ').width;\n\
-
 
5555
  ymarge = parseInt(1.5*font_size);\n\
-
 
5556
  ctx.save();\n\
-
 
5557
  ctx.fillStyle=\"rgba(255,215,0,0.2)\";\n\
-
 
5558
  ctx.rect(0,0,xmarge,ysize);\n\
-
 
5559
  ctx.rect(0,ysize-ymarge,xsize,ysize);\n\
-
 
5560
  ctx.fill();\n\
-
 
5561
  ctx.restore();\n\
-
 
5562
 }else{xmarge = 0;ymarge = 0;};\n\
5547
 if( typeof xaxislabel !== 'undefined' ){\
5563
 if( typeof xaxislabel !== 'undefined' ){\
5548
  ctx.save();\
5564
  ctx.save();\n\
5549
  ctx.font = \"italic \"+font_size+\"px Ariel\";\
5565
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5566
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
5550
  var corr =  ctx.measureText(xaxislabel).width;\
5567
  corr =  ctx.measureText(xaxislabel).width;\n\
5551
  ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\
5568
  ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\n\
5552
  ctx.restore();\
5569
  ctx.restore();\n\
5553
 };\
5570
 };\n\
5554
 if( typeof yaxislabel !== 'undefined' ){\
5571
 if( typeof yaxislabel !== 'undefined' ){\
5555
  ctx.save();\
5572
  ctx.save();\n\
5556
  ctx.font = \"italic \"+font_size+\"px Ariel\";\
5573
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5574
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
5557
  var corr = ctx.measureText(yaxislabel).width;\
5575
  corr = ctx.measureText(yaxislabel).width;\n\
5558
  ctx.translate(2*font_size,corr+font_size);\
5576
  ctx.translate(xmarge+font_size,corr+font_size);\n\
5559
  ctx.rotate(-0.5*Math.PI);\
5577
  ctx.rotate(-0.5*Math.PI);\n\
5560
  ctx.fillText(yaxislabel,0,0);\
5578
  ctx.fillText(yaxislabel,0,0);\n\
5561
  ctx.restore();\
5579
  ctx.restore();\n\
5562
 };\
5580
 };\n\
5563
 ctx.lineWidth = line_width;\n\
-
 
5564
 var x_min = Math.log(xmin)/Math.log(xlogbase);\
-
 
5565
 var x_max = Math.log(xmax)/Math.log(xlogbase);\
-
 
5566
 var y_min = Math.log(ymin)/Math.log(ylogbase);\
-
 
5567
 var y_max = Math.log(ymax)/Math.log(ylogbase);\
-
 
5568
 var xmarge;var ymarge;var x_e;var y_e;var num;var corr;var xtxt;var ytxt;\
5581
 ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
5569
 if(use_axis_numbering == 1){\
-
 
5570
  ctx.font = font_family;\
5582
 ctx.lineWidth = line_width;\n\n\
5571
  xmarge = ctx.measureText(ylogbase+'^'+y_max.toFixed(0)+' ').width;\
-
 
5572
  ymarge = parseInt(1.5*font_size);\
-
 
5573
 }else{xmarge = 0;ymarge = 0;}\
-
 
5574
 for(var p = x_min; p <= x_max ; p++){\n\
5583
 for(var p = x_min; p <= x_max ; p++){\n\
5575
  num = Math.pow(xlogbase,p);\n\
5584
  num = Math.pow(xlogbase,p);\n\n\
5576
  for(var i = 1 ; i < xlogbase ; i++){\n\
5585
  for(var i = 1 ; i < xlogbase ; i++){\n\
5577
   x_e = x2px(i*num);\n\
5586
   x_e = x2px(i*num);\n\n\
5578
   if( i == 1 ){\
5587
   if( i == 1 ){\
5579
    ctx.lineWidth = line_width;\n\
5588
    ctx.lineWidth = line_width;\n\n\
5580
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5589
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\n\
5581
    if( use_axis_numbering == 1 && p > x_min){\
5590
    if( use_axis_numbering == 1 && p > x_min){\
5582
      xtxt = xlogbase+'^'+p.toFixed(0);\
5591
      xtxt = xlogbase+'^'+p.toFixed(0);\n\
5583
      corr = 0.5*(ctx.measureText(xtxt).width);\
5592
      corr = 0.5*(ctx.measureText(xtxt).width);\n\
5584
      ctx.fillText(xtxt,x_e - corr,ysize - 4);\
5593
      ctx.fillText(xtxt,x_e - corr,ysize - 4);\n\
5585
    };\
5594
    };\n\
5586
   }else{\
5595
   }else{\
5587
    ctx.lineWidth = 0.2*line_width;\n\
5596
    ctx.lineWidth = 0.2*line_width;\n\n\
5588
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5597
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\n\
5589
   };\
5598
   };\n\
5590
   if( x_e >= xmarge ){\
5599
   if( x_e >= xmarge ){\
5591
    ctx.beginPath();\n\
5600
    ctx.beginPath();\n\
5592
    ctx.moveTo(x_e,0);\n\
5601
    ctx.moveTo(x_e,0);\n\
5593
    ctx.lineTo(x_e,ysize - ymarge);\n\
5602
    ctx.lineTo(x_e,ysize - ymarge);\n\n\
5594
    ctx.stroke();\n\
5603
    ctx.stroke();\n\
5595
    ctx.closePath();\n\
5604
    ctx.closePath();\n\
5596
   };\
5605
   };\
5597
  };\n\
5606
  };\n\
5598
 };\n\
5607
 };\n\
5599
 for(var p = y_min; p <= y_max ; p++){\n\
5608
 for(var p = y_min; p <= y_max ; p++){\n\
5600
  num = Math.pow(ylogbase,p);\n\
5609
  num = Math.pow(ylogbase,p);\n\
5601
  for(var i = 1 ; i < ylogbase ; i++){\n\
5610
  for(var i = 1 ; i < ylogbase ; i++){\n\
5602
   y_e = y2px(i*num);\n\
5611
   y_e = y2px(i*num);\n\
5603
   if( i == 1 ){\
5612
   if( i == 1 ){\n\
5604
    ctx.lineWidth = line_width;\n\
5613
    ctx.lineWidth = line_width;\n\
5605
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5614
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5606
    if( use_axis_numbering == 1 && p > y_min){\
5615
    if( use_axis_numbering == 1 && p > y_min){\n\
5607
     ctx.fillText(ylogbase+'^'+p.toFixed(0),0,y_e);\
5616
     ctx.fillText(ylogbase+'^'+p.toFixed(0),0,y_e);\n\
5608
    };\
5617
    };\n\
5609
   }else{\
5618
   }else{\n\
5610
    ctx.lineWidth = 0.2*line_width;\n\
5619
    ctx.lineWidth = 0.2*line_width;\n\
5611
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5620
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\n\
5612
   };\
5621
   };\n\
5613
   ctx.beginPath();\n\
5622
   ctx.beginPath();\n\
5614
   ctx.moveTo(xmarge,y_e);\n\
5623
   ctx.moveTo(xmarge,y_e);\n\
5615
   ctx.lineTo(xsize,y_e);\n\
5624
   ctx.lineTo(xsize,y_e);\n\
5616
   ctx.stroke();\n\
5625
   ctx.stroke();\n\
5617
   ctx.closePath();\n\
5626
   ctx.closePath();\n\
5618
  };\n\
5627
  };\n\
5619
 };\n\
5628
 };\n\
5620
 ctx.restore();\
5629
 ctx.restore();\
5621
};",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id);
5630
};",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id);
5622
    break;
5631
    break;
5623
 
5632
 
5624
case DRAW_XLOGSCALE:
5633
case DRAW_XLOGSCALE:
5625
fprintf(js_include_file,"\n<!-- draw xlogscale -->\n\
5634
fprintf(js_include_file,"\n<!-- draw xlogscale -->\n\
5626
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,use_axis_numbering,ymajor,yminor){\n\
5635
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,font_color,use_axis_numbering,ymajor,yminor){\n\
5627
 var obj;\n\
5636
 var obj;\n\
5628
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5637
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5629
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5638
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5630
 }\n\
5639
 }\n\
5631
 else\n\
5640
 else\n\
Line 5633... Line 5642...
5633
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5642
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5634
 };\n\
5643
 };\n\
5635
 var ctx = obj.getContext(\"2d\");\n\
5644
 var ctx = obj.getContext(\"2d\");\n\
5636
 ctx.clearRect(0,0,xsize,ysize);\
5645
 ctx.clearRect(0,0,xsize,ysize);\
5637
 ctx.save();\n\
5646
 ctx.save();\n\
5638
 if( typeof xaxislabel !== 'undefined' ){\
-
 
5639
  ctx.save();\
-
 
5640
  ctx.font = \"italic \"+font_size+\"px Ariel\";\
-
 
5641
  var corr =  ctx.measureText(xaxislabel).width;\
-
 
5642
  ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\
-
 
5643
  ctx.restore();\
-
 
5644
 };\
-
 
5645
 if( typeof yaxislabel !== 'undefined' ){\
-
 
5646
  ctx.save();\
-
 
5647
  ctx.font = \"italic \"+font_size+\"px Ariel\";\
-
 
5648
  var corr = ctx.measureText(yaxislabel).width;\
-
 
5649
  ctx.translate(2*font_size,corr+font_size);\
-
 
5650
  ctx.rotate(-0.5*Math.PI);\
-
 
5651
  ctx.fillText(yaxislabel,0,0);\
-
 
5652
  ctx.restore();\
-
 
5653
 };\
-
 
5654
 if(use_axis_numbering == 1){ctx.font = font_family;}\
-
 
5655
 ctx.lineWidth = line_width;\n\
5647
 ctx.lineWidth = line_width;\n\
-
 
5648
 var prec = Math.log(precision)/Math.log(10);\
5656
 var x_min = Math.log(xmin)/Math.log(xlogbase);\
5649
 var x_min = Math.log(xmin)/Math.log(xlogbase);\
5657
 var x_max = Math.log(xmax)/Math.log(xlogbase);\
5650
 var x_max = Math.log(xmax)/Math.log(xlogbase);\
5658
 var y_min = 0;var y_max = ysize;var x_e;var corr;\
5651
 var y_min = 0;var y_max = ysize;var x_e;var corr;\
5659
 var xtxt;var ytxt;var num;\
5652
 var xtxt;var ytxt;var num;var xmarge;var ymarge;\
-
 
5653
 if(use_axis_numbering == 1){\
-
 
5654
  ctx.font = font_family;\n\
-
 
5655
  xmarge = ctx.measureText(ymax.toFixed(prec)+' ').width;\n\
-
 
5656
  ymarge = parseInt(1.5*font_size);\n\
-
 
5657
  ctx.save();\n\
-
 
5658
  ctx.fillStyle=\"rgba(255,215,0,0.2)\";\n\
-
 
5659
  ctx.rect(0,0,xmarge,ysize);\n\
-
 
5660
  ctx.rect(0,ysize-ymarge,xsize,ysize);\n\
-
 
5661
  ctx.fill();\n\
-
 
5662
  ctx.restore();\n\
-
 
5663
 }else{xmarge = 0;ymarge = 0;};\n\
-
 
5664
 if( typeof xaxislabel !== 'undefined' ){\
-
 
5665
  ctx.save();\n\
-
 
5666
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5667
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5668
  corr =  ctx.measureText(xaxislabel).width;\n\
-
 
5669
  ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\n\
-
 
5670
  ctx.restore();\n\
-
 
5671
 };\n\
-
 
5672
 if( typeof yaxislabel !== 'undefined' ){\
-
 
5673
  ctx.save();\n\
-
 
5674
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5675
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5676
  corr = ctx.measureText(yaxislabel).width;\n\
-
 
5677
  ctx.translate(xmarge+font_size,corr+font_size);\n\
-
 
5678
  ctx.rotate(-0.5*Math.PI);\n\
-
 
5679
  ctx.fillText(yaxislabel,0,0);\n\
-
 
5680
  ctx.restore();\n\
-
 
5681
 };\n\
-
 
5682
 ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5683
 ctx.lineWidth = line_width;\n\n\
5660
 for(var p = x_min; p <= x_max ; p++){\n\
5684
 for(var p = x_min; p <= x_max ; p++){\n\
5661
  num = Math.pow(xlogbase,p);\n\
5685
  num = Math.pow(xlogbase,p);\n\
5662
  for(var i = 1 ; i < xlogbase ; i++){\n\
5686
  for(var i = 1 ; i < xlogbase ; i++){\n\
5663
   x_e = x2px(i*num);\n\
5687
   x_e = x2px(i*num);\n\
5664
   if( i == 1 ){\
5688
   if( i == 1 ){\
5665
    ctx.lineWidth = line_width;\n\
5689
     ctx.lineWidth = line_width;\n\
5666
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5690
     ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5667
    if( use_axis_numbering == 1){\
5691
    if( use_axis_numbering == 1 && p > x_min ){\
5668
      xtxt = xlogbase+'^'+p.toFixed(0);\
5692
      xtxt = xlogbase+'^'+p.toFixed(0);\
5669
      corr = 0.5*(ctx.measureText(xtxt).width);\
5693
      corr = 0.5*(ctx.measureText(xtxt).width);\
5670
      ctx.fillText(xtxt,x_e - corr,ysize - 4);\
5694
      ctx.fillText(xtxt,x_e - corr,ysize - 4);\
5671
    };\
5695
    };\
5672
   }else{\
5696
   }else{\
5673
    ctx.lineWidth = 0.2*line_width;\n\
5697
    ctx.lineWidth = 0.2*line_width;\n\
5674
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5698
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5675
   };\
5699
   };\
-
 
5700
   if( x_e >= xmarge ){\
5676
   ctx.beginPath();\n\
5701
    ctx.beginPath();\n\
5677
   ctx.moveTo(x_e,0);\n\
5702
    ctx.moveTo(x_e,0);\n\
5678
   ctx.lineTo(x_e,ysize);\n\
5703
    ctx.lineTo(x_e,ysize - ymarge);\n\n\
5679
   ctx.stroke();\n\
5704
    ctx.stroke();\n\
5680
   ctx.closePath();\n\
5705
    ctx.closePath();\n\
-
 
5706
   };\
5681
  };\n\
5707
  };\
5682
 };\n\
5708
 };\n\
5683
 var stepy = Math.abs(y2px(ymajor) - y2px(0));\
5709
 var stepy = Math.abs(y2px(ymajor) - y2px(0));\
5684
 var minor_step = stepy / yminor;\
5710
 var minor_step = stepy / yminor;\
5685
 var prec = Math.log(precision)/Math.log(10);\
-
 
5686
 var flip = 0;\
-
 
5687
 for(var y = 0 ; y < ysize ; y = y + stepy){\
5711
 for(var y = 0 ; y < ysize - xmarge ; y = y + stepy){\
5688
  ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5712
  ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5689
  ctx.lineWidth = line_width;\n\
5713
  ctx.lineWidth = line_width;\n\
5690
  ctx.beginPath();\n\
5714
  ctx.beginPath();\n\
5691
  ctx.moveTo(0,y);\n\
5715
  ctx.moveTo(xmarge,y);\n\
5692
  ctx.lineTo(xsize,y);\n\
5716
  ctx.lineTo(xsize,y);\n\
5693
  ctx.stroke();\n\
5717
  ctx.stroke();\n\
5694
  ctx.closePath();\n\
5718
  ctx.closePath();\n\
5695
  if( use_axis_numbering == 1){\
5719
  if( use_axis_numbering == 1){\
5696
   ytxt = (px2y(y)).toFixed(prec);\
5720
   ytxt = (px2y(y)).toFixed(prec);\
Line 5698... Line 5722...
5698
  };\
5722
  };\
5699
  for(var dy = 1 ; dy < yminor ; dy++){\
5723
  for(var dy = 1 ; dy < yminor ; dy++){\
5700
   ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5724
   ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5701
   ctx.lineWidth = 0.2*line_width;\n\
5725
   ctx.lineWidth = 0.2*line_width;\n\
5702
   ctx.beginPath();\n\
5726
   ctx.beginPath();\n\
5703
   ctx.moveTo(font_size,y+dy*minor_step);\
5727
   ctx.moveTo(xmarge,y+dy*minor_step);\
5704
   ctx.lineTo(xsize,y+dy*minor_step);\n\
5728
   ctx.lineTo(xsize,y+dy*minor_step);\n\
5705
   ctx.stroke();\n\
5729
   ctx.stroke();\n\
5706
   ctx.closePath();\n\
5730
   ctx.closePath();\n\
5707
  };\
5731
  };\
5708
 };\
5732
 };\
5709
 ctx.restore();\n\
5733
 ctx.restore();\n\
5710
};\n",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id);
5734
};\n",canvas_root_id,canvas_root_id,canvas_root_id,canvas_root_id);
5711
    break;
5735
    break;
5712
case DRAW_YLOGSCALE:
5736
case DRAW_YLOGSCALE:
5713
fprintf(js_include_file,"\n<!-- draw ylogscale -->\n\
5737
fprintf(js_include_file,"\n<!-- draw ylogscale -->\n\
5714
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,use_axis_numbering,xmajor,xminor){\n\
5738
draw_grid%d = function(canvas_type,line_width,major_color,minor_color,major_opacity,minor_opacity,font_size,font_family,font_color,use_axis_numbering,xmajor,xminor){\n\
5715
 var obj;\n\
5739
 var obj;\n\
5716
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5740
 if( document.getElementById(\"wims_canvas%d\"+canvas_type) ){\n\
5717
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5741
  obj = document.getElementById(\"wims_canvas%d\"+canvas_type);\n\
5718
 }\n\
5742
 }\n\
5719
 else\n\
5743
 else\n\
Line 5721... Line 5745...
5721
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5745
  obj = create_canvas%d(canvas_type,xsize,ysize);\n\
5722
 };\n\
5746
 };\n\
5723
 var ctx = obj.getContext(\"2d\");\n\
5747
 var ctx = obj.getContext(\"2d\");\n\
5724
 ctx.clearRect(0,0,xsize,ysize);\
5748
 ctx.clearRect(0,0,xsize,ysize);\
5725
 ctx.save();\n\
5749
 ctx.save();\n\
5726
 if( typeof xaxislabel !== 'undefined' ){\
-
 
5727
 ctx.save();\
-
 
5728
 ctx.font = \"italic \"+font_size+\"px Ariel\";\
-
 
5729
 var corr =  ctx.measureText(xaxislabel).width;\
-
 
5730
 ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\
-
 
5731
 ctx.restore();\
-
 
5732
 };\
-
 
5733
 if( typeof yaxislabel !== 'undefined' ){\
-
 
5734
  ctx.save();\
-
 
5735
  ctx.font = \"italic \"+font_size+\"px Ariel\";\
-
 
5736
  var corr =  ctx.measureText(yaxislabel).width;\
-
 
5737
  ctx.translate(2*font_size,corr+font_size);\
-
 
5738
  ctx.rotate(-0.5*Math.PI);\
-
 
5739
  ctx.fillText(yaxislabel,0,0);\
-
 
5740
  ctx.restore();\
-
 
5741
 };\
-
 
5742
 if(use_axis_numbering == 1){ctx.font = font_family;}\
-
 
5743
 ctx.lineWidth = line_width;\n\
5750
 ctx.lineWidth = line_width;\n\
5744
 var y_min = Math.log(ymin)/Math.log(ylogbase);\
5751
 var y_min = Math.log(ymin)/Math.log(ylogbase);\
5745
 var y_max = Math.log(ymax)/Math.log(ylogbase);\
5752
 var y_max = Math.log(ymax)/Math.log(ylogbase);\
5746
 var x_min = 0;var x_max = xsize;var y_s;var y_e;var num;\
5753
 var x_min = 0;var x_max = xsize;var y_s;var y_e;var num;\
-
 
5754
 if(use_axis_numbering == 1){\
-
 
5755
  ctx.font = font_family;\n\
-
 
5756
  xmarge = ctx.measureText(ylogbase+\"^\"+y_max.toFixed(0)+' ').width;\n\
-
 
5757
  ymarge = 2*font_size;\n\
-
 
5758
  ctx.save();\n\
-
 
5759
  ctx.fillStyle=\"rgba(255,215,0,0.2)\";\n\
-
 
5760
  ctx.rect(0,0,xmarge,ysize);\n\
-
 
5761
  ctx.rect(0,ysize-ymarge,xsize,ysize);\n\
-
 
5762
  ctx.fill();\n\
-
 
5763
  ctx.restore();\n\
-
 
5764
 }else{xmarge = 0;ymarge = 0;};\n\
-
 
5765
 if( typeof xaxislabel !== 'undefined' ){\
-
 
5766
  ctx.save();\n\
-
 
5767
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5768
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5769
  corr =  ctx.measureText(xaxislabel).width;\n\
-
 
5770
  ctx.fillText(xaxislabel,xsize - 1.5*corr,ysize - 2*font_size);\n\
-
 
5771
  ctx.restore();\n\
-
 
5772
 };\n\
-
 
5773
 if( typeof yaxislabel !== 'undefined' ){\
-
 
5774
  ctx.save();\n\
-
 
5775
  ctx.font = \"italic \"+font_size+\"px Ariel\";\n\
-
 
5776
  ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5777
  corr = ctx.measureText(yaxislabel).width;\n\
-
 
5778
  ctx.translate(xmarge+font_size,corr+font_size);\n\
-
 
5779
  ctx.rotate(-0.5*Math.PI);\n\
-
 
5780
  ctx.fillText(yaxislabel,0,0);\n\
-
 
5781
  ctx.restore();\n\
-
 
5782
 };\n\
-
 
5783
 ctx.fillStyle = \"rgba(\"+font_color+\",\"+major_opacity+\")\";\n\
-
 
5784
 ctx.lineWidth = line_width;\n\n\
5747
 for(var p = y_min; p <= y_max ; p++){\n\
5785
 for(var p = y_min; p <= y_max ; p++){\n\
5748
  num = Math.pow(ylogbase,p);\n\
5786
  num = Math.pow(ylogbase,p);\n\
5749
  for(var i = 1 ; i < ylogbase ; i++){\n\
5787
  for(var i = 1 ; i < ylogbase ; i++){\n\
5750
   y_e = y2px(i*num);\n\
5788
   y_e = y2px(i*num);\n\
5751
   if( i == 1 ){\
5789
   if( i == 1 ){\
5752
    ctx.lineWidth = line_width;\n\
5790
    ctx.lineWidth = line_width;\n\
5753
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5791
    ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5754
    if( use_axis_numbering == 1){\
5792
    if( use_axis_numbering == 1 && p > y_min){\
5755
     ctx.fillText(ylogbase+'^'+p.toFixed(0),0,y_e);\
5793
     ctx.fillText(ylogbase+'^'+p.toFixed(0),0,y_e);\
5756
    };\
5794
    };\
5757
   }else{\
5795
   }else{\
5758
    ctx.lineWidth = 0.2*line_width;\n\
5796
    ctx.lineWidth = 0.2*line_width;\n\
5759
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5797
    ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5760
   };\
5798
   };\
5761
   ctx.beginPath();\n\
5799
   ctx.beginPath();\n\
5762
   ctx.moveTo(0,y_e);\n\
5800
   ctx.moveTo(xmarge,y_e);\n\
5763
   ctx.lineTo(xsize,y_e);\n\
5801
   ctx.lineTo(xsize,y_e);\n\
5764
   ctx.stroke();\n\
5802
   ctx.stroke();\n\
5765
   ctx.closePath();\n\
5803
   ctx.closePath();\n\
5766
  };\n\
5804
  };\n\
5767
 };\n\
5805
 };\n\
5768
 var stepx = Math.abs(x2px(xmajor) - x2px(0));\
5806
 var stepx = Math.abs(x2px(xmajor) - x2px(0));\
5769
 var minor_step = stepx / xminor;\
5807
 var minor_step = stepx / xminor;\
5770
 var prec = Math.log(precision)/Math.log(10);\
5808
 var prec = Math.log(precision)/Math.log(10);\
5771
 var xtxt;var corr;var flip = 0;\
5809
 var xtxt;var corr;var flip = 0;\
5772
 for(var x = 0 ; x < xsize ; x = x + stepx){\
5810
 for(var x = xmarge ; x < xsize ; x = x + stepx){\
5773
  ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5811
  ctx.strokeStyle=\"rgba(\"+major_color+\",\"+major_opacity+\")\";\
5774
  ctx.lineWidth = line_width;\n\
5812
  ctx.lineWidth = line_width;\n\
5775
  ctx.beginPath();\n\
5813
  ctx.beginPath();\n\
5776
  ctx.moveTo(x,ysize);\n\
5814
  ctx.moveTo(x,ysize-ymarge);\n\
5777
  ctx.lineTo(x,0);\n\
5815
  ctx.lineTo(x,0);\n\
5778
  ctx.stroke();\n\
5816
  ctx.stroke();\n\
5779
  ctx.closePath();\n\
5817
  ctx.closePath();\n\
5780
  if( use_axis_numbering == 1){\
5818
  if( use_axis_numbering == 1){\
5781
   xtxt = (px2x(x)).toFixed(prec);\
5819
   xtxt = (px2x(x)).toFixed(prec);\
Line 5785... Line 5823...
5785
  };\
5823
  };\
5786
  for(var dx = 1 ; dx < xminor ; dx++){\
5824
  for(var dx = 1 ; dx < xminor ; dx++){\
5787
   ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5825
   ctx.strokeStyle=\"rgba(\"+minor_color+\",\"+minor_opacity+\")\";\
5788
   ctx.lineWidth = 0.2*line_width;\n\
5826
   ctx.lineWidth = 0.2*line_width;\n\
5789
   ctx.beginPath();\n\
5827
   ctx.beginPath();\n\
5790
   ctx.moveTo(x+dx*minor_step,ysize - font_size);\
5828
   ctx.moveTo(x+dx*minor_step,ysize - ymarge);\
5791
   ctx.lineTo(x+dx*minor_step,0);\n\
5829
   ctx.lineTo(x+dx*minor_step,0);\n\
5792
   ctx.stroke();\n\
5830
   ctx.stroke();\n\
5793
   ctx.closePath();\n\
5831
   ctx.closePath();\n\
5794
  };\
5832
  };\
5795
 };\
5833
 };\