Skip to content

keysolutions/cksparkline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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.

  • drawPoints (property) draws an ellipse at each data point, with the final point drawn in red.

  • drawArea (property) fills the area below the line.

Example Usage

Include CKSparkline.m and CKSparkline.h in your application's Xcode project.

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];

About

Sparklines for Cocoa Touch applications

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 4

  •  
  •  
  •  
  •