Skip to content

Commit

Permalink
Added Example project + sources.
Browse files Browse the repository at this point in the history
  • Loading branch information
anaglik committed Aug 6, 2014
1 parent 2888f50 commit afc579f
Show file tree
Hide file tree
Showing 425 changed files with 20,417 additions and 2 deletions.
32 changes: 32 additions & 0 deletions ANDLineChartView.podspec
@@ -0,0 +1,32 @@
#
# Be sure to run `pod lib lint ANDLineChartView.podspec' to ensure this is a
# valid spec and remove all comments before submitting the spec.
#
# Any lines starting with a # are optional, but encouraged
#
# To learn more about a Podspec see http://guides.cocoapods.org/syntax/podspec.html
#

Pod::Spec.new do |s|
s.name = "ANDLineChartView"
s.version = "0.1.0"
s.summary = "ANDLineChartView is easy to use view-based class for displaying animated line chart."
s.description = <<-DESC
ANDLineChartView is easy to use view-based class for displaying animated line chart.
* Markdown format.
* Don't worry about the indent, we strip it!
DESC
s.homepage = "https://github.com/anaglik/ANDLineChartView"
s.screenshots = "https://raw.github.com/anaglik/ANDLineChartView/master/screen1.png",
"https://raw.github.com/anaglik/ANDLineChartView/master/screen2.png"
s.license = 'MIT'
s.author = { "Andrzej Naglik" => "dev.an@icloud.com" }
s.source = { :git => "https://github.com/anaglik/ANDLineChartView.git", :tag => s.version.to_s }
s.social_media_url = 'https://twitter.com/andy_namic'

s.platform = :ios, '7.0'
s.requires_arc = true

s.source_files = 'ANDLineChartView'
end
62 changes: 62 additions & 0 deletions ANDLineChartView/ANDLineChartView.h
@@ -0,0 +1,62 @@
//
// ANDExampleViewController.h
// SimpleAnimatedGraph v.0.1.0
//
// Created by Andrzej Naglik on 19.01.2014.
// Copyright (c) 2014 Andrzej Naglik. All rights reserved.
//

#import <UIKit/UIKit.h>

@protocol ANDLineChartViewDataSource,ANDLineChartViewDelegate;

@interface ANDLineChartView : UIView

@property (nonatomic, weak) id<ANDLineChartViewDataSource> dataSource;
@property (nonatomic, weak) id<ANDLineChartViewDelegate> delegate;

@property (nonatomic, strong) UIFont *gridIntervalFont;

@property (nonatomic, strong) UIColor *chartBackgroundColor;
@property (nonatomic, strong) UIColor *gridIntervalLinesColor;
@property (nonatomic, strong) UIColor *gridIntervalFontColor;

@property (nonatomic, strong) UIColor *elementColor;
@property (nonatomic, strong) UIColor *elementStrokeColor;
@property (nonatomic, strong) UIColor *lineColor;

@property (nonatomic, assign) CGFloat elementSpacing;//default is 30

// Support for constraint-based layout (auto layout)
// If nonzero, this is used when determining -intrinsicContentSize
@property(nonatomic, assign) CGFloat preferredMinLayoutWidth;

- (void)reloadData;
@end

@protocol ANDLineChartViewDataSource <NSObject>

@required
- (NSUInteger)numberOfElementsInChartView:(ANDLineChartView *)chartView;

- (CGFloat)chartView:(ANDLineChartView *)chartView valueForElementAtRow:(NSUInteger)row;

- (NSUInteger)numberOfGridIntervalsInChartView:(ANDLineChartView *)chartView;

// Values may be displayed differently eg. One might want to present 4200 seconds as 01h:10:00
- (NSString*)chartView:(ANDLineChartView *)chartView descriptionForGridIntervalValue:(CGFloat)interval;

- (CGFloat)maxValueForGridIntervalInChartView:(ANDLineChartView *)chartView;

- (CGFloat)minValueForGridIntervalInChartView:(ANDLineChartView *)chartView;

@end

@protocol ANDLineChartViewDelegate <NSObject>
@optional
// you can specify spacing from previous element to element at current row. If it is first element, spacing is computed
// from left border of view.
// if you want to have the same spacing between every element, use elementSpacing property from ANDGraphView
- (CGFloat)chartView:(ANDLineChartView *)chartView spacingForElementAtRow:(NSUInteger)row;

@end

0 comments on commit afc579f

Please sign in to comment.