This is definition of class which I use in my Pie Chart 3D app
More about library you can read on https://iphone.orpi.pl/?p=20
//
// GraphView.h
// wynagrodzen
//
// Created by ORPI.pl on 10-09-08.
// Copyright 2010 ORPI.pl. All rights reserved.
//
#import
@class GraphView;
@protocol GraphViewDelegate
@optional
- (void)graphView:(GraphView *)graphView didSelectSliceAtIndex:(NSNumber *)indexPath;
- (void)chartShaked:(UIEvent *)event;
- (void)settings;
@end
@interface GraphView : UIView {
// labels - array of NSStrings
NSMutableArray *labels;
// values - array of NSNumber
NSMutableArray *values;
// colors should be defined as hue parameter of color, this is optional value
NSArray *colors;
// colorsToSlices defines on which position of colors array is our color
NSMutableArray *colorsToSlices;
NSMutableArray *myColors;
NSString *chartTitle;
float chartHeight;
float radiusStep;
float inclination;
float startAngleStep;
BOOL showLabels;
int labelsType;
int labelsDigits;
CGFloat chartCenterX;
CGFloat chartCenterY;
CGFloat chartOffset;
CGFloat initialXPosition;
CGFloat initialYPosition;
CGFloat beginPositionX;
CGFloat beginPositionY;
CGFloat initialDistance;
CGFloat initialAngle;
int moveDetectedType;
BOOL allowMotion;
NSMutableArray *normalisedChartValues;
float movedZ;
float movedX;
float movedY;
}
@property(nonatomic,assign) id delegate;
@property (nonatomic,retain) NSMutableArray *labels;
@property (nonatomic,retain) NSMutableArray *values;
@property (nonatomic,retain) NSArray *colors;
@property (nonatomic,retain) NSMutableArray *colorsToSlices;
@property (nonatomic,retain) NSString *chartTitle;
@property (nonatomic) float chartHeight;
@property (nonatomic) float radiusStep;
@property (nonatomic) float inclination;
@property (nonatomic) float startAngleStep;
@property (nonatomic) BOOL showLabels;
@property (nonatomic) int labelsType;
@property (nonatomic) int labelsDigits;
@property (nonatomic) BOOL allowMotion;
- (CGFloat)distanceBetweenTwoPoints:(CGPoint)fromPoint toPoint:(CGPoint)toPoint;
- (NSNumber *)tappedSliceId:(CGFloat)angle;
-(void)setLabelForSlice:(NSNumber *)sliceId value:(NSString *)value;
-(void)setValueForSlice:(NSNumber *)sliceId value:(NSNumber *)value;
-(void)setzColorForSlice:(NSNumber *)sliceId value:(NSNumber *)value;
-(NSString *)getLabelForSlice:(NSNumber *)sliceId;
-(NSNumber *)getValueForSlice:(NSNumber *)sliceId;
-(NSNumber *)getColorForSlice:(NSNumber *)sliceId;
-(NSNumber *)pushSliceForward:(NSNumber *)sliceId;
-(NSNumber *)pushSliceBack:(NSNumber *)sliceId;
-(void)removeSlice:(NSNumber *)sliceId;
-(NSNumber *)addSlice;
-(void)setChartTitle:(NSString *)newChartTitle;
-(void)setLabelsDigits:(int)newlabelsdigits;
@end
Leave a Reply
You must be logged in to post a comment.