I'd like to achieve this gauge but with whole numbers as the labels, so that "0" is at the top.
Sample project available here:
https://www.dropbox.com/s/zks2lisirer59te/NegativeGaugeBug.zip?dl=0
Here's what I came up with for a short-term fix for this use-case.
CGFloat minimum = -M_PI;
CGFloat maximum = M_PI;
self.gaugeView.minimumValue = roundf(minimum);
self.gaugeView.maximumValue = roundf(maximum);
CGFloat actualDelta = maximum - minimum;
CGFloat coveredDelta = self.gaugeView.maximumValue - self.gaugeView.minimumValue;
CGFloat totalAngle = (360 - self.gaugeView.scaleStartAngle) + (self.gaugeView.scaleEndAngle);
CGFloat degreePerUnit = totalAngle / coveredDelta;
CGFloat unclaimedTerritory = actualDelta - coveredDelta;
self.gaugeView.scaleOversweep = (unclaimedTerritory * degreePerUnit) / 2.0;
...with value set to -M_PI.
Or as an alternative, if you'd rather show fractions of Pi, you can keep the min and max as -Pi and Pi and set the interval to Pi/2 or something like that. Then you can format labels using -gaugeView:formatStringForValue: to show -Pi, -Pi/2, 0, etc.
Hey Caylan,
So your best bet is to set the min and max to -3 and 3 respectively. And then set the scaleOversweep property. Its a value in degrees, that determines the amount of extra space that is displayed before and after the min and max values.
Now, don't worry, b/c you can actually still set the value of the gauge to be greater and less than the min and max values. Those properties are really for controlling the label/tick mark positions, and no way limit the value that you can set.
-SteveZ