Skip to content
Kevin Brewster edited this page Jan 23, 2015 · 2 revisions

Dataset is a [CAShapeLayer] (https://developer.apple.com/library/mac/documentation/GraphicsImaging/Reference/CAShapeLayer_class/index.html) subclass and thus you can change it's strokeColor and fillColor properties among others.

Properties

var xAxis: Axis
var yAxis: Axis

var label: String

The string that is displayed on the labelLayer. Changing this will automatically update the legend.


var data: [CGFloat]

The data for the dataset. Changing this will automatically refresh the graph.


var defaultPoint: CAShapeLayer

The template for all points on the line. You can change any CAShapeLayer properties (e.g. strokeColor, lineWidth). Changing any properties will automatically refresh all points.


var color: CGColor

This is a convenience property which, when set, will (a) set the strokeColor to given color and (b) set the fillColor to a very transparent version of the given color, and (c) update the defaultPoint fillColor and (d) update the legendMarker fillColor


var legendElement: CALayer
var legendMarker: CAShapeLayer
var legendLabel: CATextLayer

The legendElement is a container for the legendMarker and legendLabel, which is displayed in the top-right of graph when legendEnabled is true. legendLabel is automatically updated when the Dataset.label property is changed. legendMarker is automatically updated when the Dataset.color property is changed.


Clone this wiki locally