SGaugeStyle Class Reference

Inherits from NSObject
Conforms to NSCopying
Declared in SGaugeStyle.h
Availability
Related samples

Overview

The SGaugeStyle offers control over the appearance of the SGauge

Styling axes and axis labels

Styling the needle

Applying colors to the ranges and background

Properties

axisMirrorBehavior

An integer bitmask that determines how the tickmarks and ticklabels are mirrored. Defaults to SGaugeTickMirrorNone.

@property (nonatomic, assign) enum SGaugeTickMirror axisMirrorBehavior

Discussion

The value of this mask is specified by combining the constants defined in SGaugeTickMirror using the C bitwise OR operator.

  • SGaugeTickMirrorNone: The option for indicating that nothing will be mirrored.
  • SGaugeTickMirrorTickmarks: The option for indicating that the tickmarks will be mirrored.
  • SGaugeTickMirrorTicklabels: The option for indicating that the ticklabels will be mirrored.
  • SGaugeTickMirrorBaseline: The option for indicating that the baseline will be mirrored.

Declared In

SGaugeStyle.h

axisPadding

The amount of padding on either end of the axis before the border is drawn.

@property (nonatomic, assign) CGFloat axisPadding

Declared In

SGaugeStyle.h

bevelFlatProportion

The proportion of the bevel which is “flat” at the edge, before sloping in towards the center. Defaults to 0.5.

@property (nonatomic, assign) CGFloat bevelFlatProportion

Declared In

SGaugeStyle.h

bevelPrimaryColor

The color of the bevel, used around the gauge perimeter.

@property (nonatomic, retain) UIColor *bevelPrimaryColor

Discussion

The bevel uses a linear gradient between bevelPrimaryColor and bevelSecondaryColor.

Declared In

SGaugeStyle.h

bevelSecondaryColor

The secondary color of the bevel, used around the gauge perimeter.

@property (nonatomic, retain) UIColor *bevelSecondaryColor

Discussion

The bevel uses a linear gradient between bevelPrimaryColor and bevelSecondaryColor.

Declared In

SGaugeStyle.h

bevelWidth

The size of the bevel around the gauge.

@property (nonatomic, assign) CGFloat bevelWidth

Declared In

SGaugeStyle.h

borderIsFullCircle

Whether or not the border should stop at the edge of the axis track, or form a full circle.

@property (nonatomic, assign) BOOL borderIsFullCircle

Discussion

This only applies to the style of radial gauges. If YES, the border and background will be drawn as a full circle. If NO, the border and background will start at the arcAngleStart, and finish at the arcAngleEnd.

Declared In

SGaugeStyle.h

cornerRadius

The radius of the corners of the SGaugeLinear and bevel.

@property (nonatomic, assign) CGFloat cornerRadius

Declared In

SGaugeStyle.h

fillToValue

Whether or not to fill the gauge up from the minimum to the current value. Defaults to NO.

@property (nonatomic, assign) BOOL fillToValue

Declared In

SGaugeStyle.h

fillValueBorderColor

The color of the border around the Value Fill.

@property (nonatomic, retain) UIColor *fillValueBorderColor

Declared In

SGaugeStyle.h

fillValueBorderWidth

The width of the border around the Value Fill. Defaults to 0.

@property (nonatomic, assign) CGFloat fillValueBorderWidth

Declared In

SGaugeStyle.h

fillValueColor

The color of the Value Fill.

@property (nonatomic, retain) UIColor *fillValueColor

Declared In

SGaugeStyle.h

fillValueInnerRadius

The inner radius of the Fill Value, as a proportion of the whole height. Defaults to 0.4.

@property (nonatomic, assign) CGFloat fillValueInnerRadius

Declared In

SGaugeStyle.h

fillValueOuterRadius

The inner radius of the Fill Value, as a proportion of the whole height. Defaults to 0.6.

@property (nonatomic, assign) CGFloat fillValueOuterRadius

Declared In

SGaugeStyle.h

glassColor

The color of the glass effect over the gauge.

@property (nonatomic, retain) UIColor *glassColor

Declared In

SGaugeStyle.h

innerBackgroundColor

The background color to use at the inner edge of the gauge. If different from the outerBackgroundColor, a gradient will be drawn between the two.

@property (nonatomic, retain) UIColor *innerBackgroundColor

Declared In

SGaugeStyle.h

knobBorderColor

The color of the border around the knob at the end of the needle.

@property (nonatomic, retain) UIColor *knobBorderColor

Declared In

SGaugeStyle.h

knobBorderWidth

The width of the border around the knob at the end of the needle, measured in points.

@property (nonatomic, assign) CGFloat knobBorderWidth

Declared In

SGaugeStyle.h

knobColor

The color of the knob at the end of the needle.

@property (nonatomic, retain) UIColor *knobColor

Declared In

SGaugeStyle.h

knobRadius

The radius of the knob at the end of the needle, in points.

@property (nonatomic, assign) CGFloat knobRadius

Declared In

SGaugeStyle.h

majorTickColor

The color of the major tick marker.

@property (nonatomic, retain) UIColor *majorTickColor

Declared In

SGaugeStyle.h

majorTickSize

The dimensions of the major ticks. Default to {2, 12}.

@property (nonatomic, assign) CGSize majorTickSize

Declared In

SGaugeStyle.h

minorTickColor

The color of the minor tick marker.

@property (nonatomic, retain) UIColor *minorTickColor

Declared In

SGaugeStyle.h

minorTickSize

The dimensions of the minor ticks. Default to {1, 6}.

@property (nonatomic, assign) CGSize minorTickSize

Declared In

SGaugeStyle.h

needleBorderColor

The color of the needle border.

@property (nonatomic, retain) UIColor *needleBorderColor

Declared In

SGaugeStyle.h

needleBorderWidth

The width of the needle border, measured in points.

@property (nonatomic, assign) CGFloat needleBorderWidth

Declared In

SGaugeStyle.h

needleColor

The color of the needle.

@property (nonatomic, retain) UIColor *needleColor

Declared In

SGaugeStyle.h

needleLength

The length of the needle, as a proportion of the radius.

@property (nonatomic, assign) CGFloat needleLength

Discussion

When set to 1, the needle reaches from the center to the axis. When set to 0.5, the needle reaches from the center to half way between the center and axis.

Declared In

SGaugeStyle.h

needleWidth

The width of the needle.

@property (nonatomic, assign) CGFloat needleWidth

Declared In

SGaugeStyle.h

outerBackgroundColor

The background color to use at the outer edge of the gauge. If different from the innerBackgroundColor, a gradient will be drawn between the two.

@property (nonatomic, retain) UIColor *outerBackgroundColor

Declared In

SGaugeStyle.h

qualitativeRangeActiveSegmentIsColored

Whether or not to draw the Qualitative Range from the minimum to the current value. Default to NO.

@property (nonatomic, assign) BOOL qualitativeRangeActiveSegmentIsColored

Declared In

SGaugeStyle.h

qualitativeRangeBorderColor

The color of the border around Qualitative Ranges.

@property (nonatomic, retain) UIColor *qualitativeRangeBorderColor

Declared In

SGaugeStyle.h

qualitativeRangeBorderWidth

The width of the border around Qualitative Ranges. Defaults to 0.

@property (nonatomic, assign) CGFloat qualitativeRangeBorderWidth

Declared In

SGaugeStyle.h

qualitativeRangeInnerPosition

The inner radius of the Qualitative Range, as a proportion of the whole height. Defaults to 0.75.

@property (nonatomic, assign) CGFloat qualitativeRangeInnerPosition

Declared In

SGaugeStyle.h

qualitativeRangeOuterPosition

The outer radius of the Qualitative Range, as a proportion of the whole height. Defaults to 1.0.

@property (nonatomic, assign) CGFloat qualitativeRangeOuterPosition

Declared In

SGaugeStyle.h

showGlassEffect

Whether or not to add a glass effect to the gauge. Defaults to YES.

@property (nonatomic, assign) BOOL showGlassEffect

Declared In

SGaugeStyle.h

showTickLabels

Whether or not tick mark labels should be displayed. Defaults to YES.

@property (nonatomic, assign) BOOL showTickLabels

Declared In

SGaugeStyle.h

tickBaselineColor

The color of the Tick track baseline.

@property (nonatomic, retain) UIColor *tickBaselineColor

Declared In

SGaugeStyle.h

tickBaselinePosition

The offset from the axis to display the baseline, as a proportion of the total radius. Defaults to 1.

@property (nonatomic, assign) CGFloat tickBaselinePosition

Discussion

At 1, the baseline touches the axis. A lower value draws the baseline closer to the center. A higher value draws the baseline further from the center.

Declared In

SGaugeStyle.h

tickBaselineWidth

The width of the Tick track baseline.

@property (nonatomic, assign) CGFloat tickBaselineWidth

Declared In

SGaugeStyle.h

tickLabelColor

The text color of the axis labels.

@property (nonatomic, retain) UIColor *tickLabelColor

Declared In

SGaugeStyle.h

tickLabelFont

The font and size to use for tick mark labels. Defaults to HelveticaNeue

@property (nonatomic, retain) UIFont *tickLabelFont

Declared In

SGaugeStyle.h

tickLabelOffsetFromBaseline

The offset from the baseline to draw the tick mark labels at. Default to 20pts.

@property (nonatomic, assign) CGFloat tickLabelOffsetFromBaseline

Discussion

In a radial gauge, this will place the labels this many points further from the center than the major tick labels. In a linear gauge, this will place the labels this many points underneath the major tick labels.

Declared In

SGaugeStyle.h

tickLabelsRotate

Whether the tick labels will be displayed horizontally, or whether they will rotate around the edge of a radial gauge. Defaults to NO.

@property (nonatomic, assign) BOOL tickLabelsRotate

Discussion

If YES, the tick labels will rotate around the axis. If NO, all tick labels will be drawn horizontally.

Declared In

SGaugeStyle.h

tickMarkAlignment

The alignment of the tickmarks from the baseline. Defaults to SGaugeTickAlignTop.

@property (nonatomic, assign) SGaugeTickAlign tickMarkAlignment

Discussion

  • SGaugeTickAlignTop: The tick marks will be drawn from the baseline, radiating inwards.
  • SGaugeTickAlignBottom: The tick marks will be drawn from the baseline, radiating outwards.
  • SGaugeTickAlignCenter: The tick marks will be drawn centered on the baseline.

Declared In

SGaugeStyle.h