示例#1
0
 public void DrawGaugeArea(SKCanvas canvas, ChartEntry entry, float radius, int cx, int cy, float strokeWidth)
 {
     using (var paint = new SKPaint
     {
         Style = SKPaintStyle.Stroke,
         StrokeWidth = strokeWidth,
         Color = entry.Color.WithAlpha(this.LineAreaAlpha),
         IsAntialias = true,
     })
     {
         canvas.DrawCircle(cx, cy, radius, paint);
     }
 }
示例#2
0
 public void DrawGauge(SKCanvas canvas, ChartEntry entry, float radius, int cx, int cy, float strokeWidth)
 {
     using (var paint = new SKPaint
     {
         Style = SKPaintStyle.Stroke,
         StrokeWidth = strokeWidth,
         StrokeCap = SKStrokeCap.Round,
         Color = entry.Color,
         IsAntialias = true,
     })
     {
         using (SKPath path = new SKPath())
         {
             var sweepAngle = this.AnimationProgress * 360 * (Math.Abs(entry.Value) - this.AbsoluteMinimum) / this.ValueRange;
             path.AddArc(SKRect.Create(cx - radius, cy - radius, 2 * radius, 2 * radius), this.StartAngle, sweepAngle);
             canvas.DrawPath(path, paint);
         }
     }
 }