I am trying to add values to arc and made a method for that purpose. However it looks like all of them are in one place even thought there are different coordinates given with for loop. What might be the problem?
this.RangeEnd is float 200
Here is method for adding values:
private void OnDrawValues()
{
using (SKPath scalePath = new SKPath())
{
for (int i = 0; i <= this.RangeEnd; i += 20)
{
double theta = (7 * Math.PI / 4) - (i * (2 * Math.PI / 40));
double xPos = (_gaugeRect.Width / 2) * 1.2 * Math.Sin(theta) + _drawRect.MidX - 20 / 2;
double yPos = (_gaugeRect.Width / 2) * 1.2 * Math.Cos(theta) + _drawRect.MidY + 20 / 2;
using (SKPaint paint = new SKPaint())
{
paint.Color = SKColors.White;
paint.IsAntialias = true;
paint.TextSize = 40;
_canvas.DrawText(i.ToString(), (float)xPos, (float)yPos, paint);
}
}
}
}
Here is the output:
EDIT:
private void OnDrawValues()
{
using (SKPath scalePath = new SKPath())
{
double theta = 0;
for (int i = 0; i <= this.RangeEnd; i += 20)
{
theta += (7 * Math.PI / 4) - (i * (2 * Math.PI / 40));
double xPos = (_gaugeRect.Width / 2) * 1.2 * Math.Sin(theta) + _drawRect.MidX - 20 / 2;
double yPos = (_gaugeRect.Width / 2) * 1.2 * Math.Cos(theta) + _drawRect.MidY + 20 / 2;
using (SKPaint paint = new SKPaint())
{
paint.Color = SKColors.White;
paint.IsAntialias = true;
paint.TextSize = 40;
_canvas.DrawText(i.ToString(), (float)xPos, (float)yPos, paint);
}
}
}
}
produces following result: