iOS & macOS Charting Documentation - SciChart iOS & macOS Charts SDK v4.x
Other Functions
The following functions are available globally.
-
Undocumented
Declaration
Objective-C
static inline void DrawAnnotationAttributedString(CGContextRef _Nonnull context, NSAttributedString * _Nonnull string, CGRect rect, SCIColor * _Nonnull backgroundColor, SCIEdgeInsets padding) { CGMutablePathRef path = CGPathCreateMutable(); CGPathAddRect(path, nil, CGRectMake(padding.left, padding.bottom, rect.size.width - padding.left - padding.right, rect.size.height - padding.top - padding.bottom)); CTFramesetterRef frameSetter = CTFramesetterCreateWithAttributedString((CFAttributedStringRef)string); CTFrameRef frame = CTFramesetterCreateFrame(frameSetter, CFRangeMake(0, string.length), path, nil); CGContextSetFillColorWithColor(context,backgroundColor.CGColor); CGContextFillRect(context, rect); CTFrameDraw(frame, context); CGPathRelease(path); CFRelease(frameSetter); CFRelease(frame); }Swift
func DrawAnnotationAttributedString(_ context: CGContext, _ string: NSAttributedString, _ rect: CGRect, _ backgroundColor: CIColor, _ padding: UIEdgeInsets) -
Apply a SCIAlighnment constant to an object.
Warning
This function is desined for initernal use only.Declaration
Objective-C
static inline CGRect SCIApplyAlignmentInternal(SCIAlignment alignment, CGFloat w, CGFloat h, CGFloat xAdj, CGFloat yAdj, CGRect container)Swift
func SCIApplyAlignmentInternal(_ alignment: SCIAlignment, _ w: CGFloat, _ h: CGFloat, _ xAdj: CGFloat, _ yAdj: CGFloat, _ container: CGRect) -> CGRectParameters
alignmentThe desired placement of the object, as defined by the SCIAlignment constants.
wThe horizontal size of the object.
hThe vertical size of the object.
containerThe frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.
xAdjOffset to apply to the X axis.
yAdjOffset to apply to the Y axis.
Return Value
The computed frame of the object in its container.
-
Apply a SCIAlighnment constant to an object.
Warning
This function is desined for initernal use only.Declaration
Objective-C
static inline CGRect SCIApplyAlignmentWH(SCIAlignment alignment, CGFloat w, CGFloat h, CGRect container)Swift
func SCIApplyAlignmentWH(_ alignment: SCIAlignment, _ w: CGFloat, _ h: CGFloat, _ container: CGRect) -> CGRectParameters
alignmentThe desired placement of the object, as defined by the SCIAlignment constants.
wThe horizontal size of the object.
hThe vertical size of the object.
containerThe frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.
Return Value
The computed frame of the object in its container.
-
Apply a
SCIAlighnmentconstant to an object.Warning
This function is desined for initernal use only.Declaration
Objective-C
static inline CGRect SCIApplyAlignment(SCIAlignment alignment, CGSize size, CGRect container)Swift
func SCIApplyAlignment(_ alignment: SCIAlignment, _ size: CGSize, _ container: CGRect) -> CGRectParameters
alignmentThe desired placement of the object, as defined by the
SCIAlignmentconstants.sizeThe size of the object.
containerThe frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.
Return Value
The computed frame of the object in its container.
-
Calculates the frame of the object in its container.
Warning
This function is desined for initernal use only.Declaration
Objective-C
static inline CGRect SCICalculateFrameWithAlignment(SCIAlignment alignment, CGPoint point, CGSize size, CGRect container, _Bool isLeft, _Bool isTop)Swift
func SCICalculateFrameWithAlignment(_ alignment: SCIAlignment, _ point: CGPoint, _ size: CGSize, _ container: CGRect, _ isLeft: Bool, _ isTop: Bool) -> CGRectParameters
alignmentThe desired placement of the object, relative to
point, as defined by the SCIAlignment constants.pointThe point relative to which object will be placed.
sizeThe size of the object.
containerThe frame of the containing space, in which the object will be placed. Should be large enough to contain the width and height of the object.
Return Value
The computed frame of the object in its container.
View on GitHub