Esempio n. 1
0
 protected virtual void DrawGraph(IGraphicsCache cache, Rectangle contentBounds)
 {
     contentBounds.Inflate(1, 1);
     currentSparkline.Size            = contentBounds.Size;
     currentSparkline.Properties.View = new AreaSparklineView();
     using (Bitmap bitmap = new Bitmap(currentSparkline.Size.Width, currentSparkline.Size.Height)) {
         currentSparkline.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
         cache.DrawImage(bitmap, contentBounds);
     }
 }
Esempio n. 2
0
 protected virtual void DrawGraph(Graphics graphics, Rectangle contentBounds)
 {
     graphics.Clear(Color.Transparent);
     contentBounds.Inflate(1, 1);
     currentSparkline.Size            = contentBounds.Size;
     currentSparkline.Properties.View = new AreaSparklineView();
     using (Bitmap bitmap = new Bitmap(currentSparkline.Size.Width, currentSparkline.Size.Height)) {
         currentSparkline.DrawToBitmap(bitmap, new Rectangle(0, 0, bitmap.Width, bitmap.Height));
         graphics.DrawImage(bitmap, contentBounds.X, contentBounds.Y);
     }
 }