Sparklines for Cocoa Touch applications
Switch branches/tags
Nothing to show
Pull request Compare This branch is 19 commits behind keysolutions:master.
Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Failed to load latest commit information.
examples/SparklineViewer
src
.gitignore
LICENSE
README.mdown

README.mdown

CKSparkline

CKSparkline is an open source library that provides your application easy access to Sparkline Graphs. Sparklines are well suited to visualizing information in the screen resolution available to the iPhone and iPod Touch.

Attributes

  • data (property) sets the datasource for the view. Datasource is provided as a NSArray containing NSNumber objects.

  • lineColor (property) sets the color used for line display. Color is supplied as a UIColor object.

  • highlightedColor (property) sets the color to be used for line display when the view is selected. Color is supplied as a UIColor object.

  • lineWidth (property) sets the width used for line display.

  • selected (property) sets if the view is selected. BOOL YES or NO.

Example Usage

CKSparkline *sparkline = [[CKSparkline alloc]
    initWithFrame:CGRectMake(0.0, 0.0, 100.0, 30.0)];

// Sample data
sparkline.data = [NSArray arrayWithObjects:
                  [NSNumber numberWithFloat:2.0],
                  [NSNumber numberWithFloat:4.5],
                  [NSNumber numberWithFloat:5.2],
                  [NSNumber numberWithFloat:7.1],
                  [NSNumber numberWithFloat:2.3],
                  [NSNumber numberWithFloat:3.9],
                  [NSNumber numberWithFloat:1.2],
                  nil];

[parentView addSubview:sparkline];
[sparkline release];

Be sure to include CKSparkline.m and CKSparkline.h into your application project.