예제 #1
0
 private void drawGrid()
 {
     if (!gdef.onlyGraph)
     {
         Color       shade1 = gdef.colors[COLOR_SHADEA], shade2 = gdef.colors[COLOR_SHADEB];
         const float borderStroke = 1;
         worker.drawLine(0, 0, im.xgif - 1, 0, shade1, borderStroke);
         worker.drawLine(1, 1, im.xgif - 2, 1, shade1, borderStroke);
         worker.drawLine(0, 0, 0, im.ygif - 1, shade1, borderStroke);
         worker.drawLine(1, 1, 1, im.ygif - 2, shade1, borderStroke);
         worker.drawLine(im.xgif - 1, 0, im.xgif - 1, im.ygif - 1, shade2, borderStroke);
         worker.drawLine(0, im.ygif - 1, im.xgif - 1, im.ygif - 1, shade2, borderStroke);
         worker.drawLine(im.xgif - 2, 1, im.xgif - 2, im.ygif - 2, shade2, borderStroke);
         worker.drawLine(1, im.ygif - 2, im.xgif - 2, im.ygif - 2, shade2, borderStroke);
         if (gdef.drawXGrid)
         {
             new TimeAxis(this).draw();
         }
         if (gdef.drawYGrid)
         {
             bool ok;
             if (gdef.altYMrtg)
             {
                 ok = new ValueAxisMrtg(this).draw();
             }
             else if (gdef.logarithmic)
             {
                 ok = new ValueAxisLogarithmic(this).draw();
             }
             else
             {
                 ok = new ValueAxis(this).draw();
             }
             if (!ok)
             {
                 String msg = "No Data Found";
                 worker.drawString(msg,
                                   im.xgif / 2 - (int)worker.getStringWidth(msg, gdef.largeFont) / 2,
                                   (2 * im.yorigin - im.ysize) / 2,
                                   gdef.largeFont, gdef.colors[COLOR_FONT]);
             }
         }
     }
 }
예제 #2
0
파일: RrdGraph.cs 프로젝트: mujing/rrd4net
 private void drawGrid()
 {
    if (!gdef.onlyGraph)
    {
       Color shade1 = gdef.colors[COLOR_SHADEA], shade2 = gdef.colors[COLOR_SHADEB];
       const float borderStroke = 1;
       worker.drawLine(0, 0, im.xgif - 1, 0, shade1, borderStroke);
       worker.drawLine(1, 1, im.xgif - 2, 1, shade1, borderStroke);
       worker.drawLine(0, 0, 0, im.ygif - 1, shade1, borderStroke);
       worker.drawLine(1, 1, 1, im.ygif - 2, shade1, borderStroke);
       worker.drawLine(im.xgif - 1, 0, im.xgif - 1, im.ygif - 1, shade2, borderStroke);
       worker.drawLine(0, im.ygif - 1, im.xgif - 1, im.ygif - 1, shade2, borderStroke);
       worker.drawLine(im.xgif - 2, 1, im.xgif - 2, im.ygif - 2, shade2, borderStroke);
       worker.drawLine(1, im.ygif - 2, im.xgif - 2, im.ygif - 2, shade2, borderStroke);
       if (gdef.drawXGrid)
       {
          new TimeAxis(this).draw();
       }
       if (gdef.drawYGrid)
       {
          bool ok;
          if (gdef.altYMrtg)
          {
             ok = new ValueAxisMrtg(this).draw();
          }
          else if (gdef.logarithmic)
          {
             ok = new ValueAxisLogarithmic(this).draw();
          }
          else
          {
             ok = new ValueAxis(this).draw();
          }
          if (!ok)
          {
             String msg = "No Data Found";
             worker.drawString(msg,
                     im.xgif / 2 - (int)worker.getStringWidth(msg, gdef.largeFont) / 2,
                     (2 * im.yorigin - im.ysize) / 2,
                     gdef.largeFont, gdef.colors[COLOR_FONT]);
          }
       }
    }
 }