OKChart class documentation

Authors

Riccardo Mottola

Copyright: (C) 2011-2017 Free Software Foundation


Contents -

  1. Software documentation for the OKChart class
  2. OKChart types

Software documentation for the OKChart class

OKChart : NSView

Declared in:
OKChart.h

OKChart provides the superclass for different chart types. It comprises generic properties and methods for a chart class.
A chart is a plotting of one or more series of values in manners similar to a spreadsheet graph. Values are generally not thought to be dependent upn each other, that is, not a function-plotting although it can be used for that.

OresmeKit provides several instances like the Line chart or Pie chart. You may of course sublass it and implement your own custom chart type.

Data Series

OKChart s draw data is represented in OKSeries . Depending on the chart style, one or more series are supported or needed.

Series may be managed by

Drawing

An OKChart is a subclass of NSView, thus the final drawing happens in the drawRect.


Instance Variables

Method summary

format: withFormat: 

+ (NSString*) format: (NSNumber*)number withFormat: (OKNumberFormatting)fmt;
Utility method to format number with the passed format OKNumberFormatting

purgeTrailingZeroes: 

+ (NSString*) purgeTrailingZeroes: (NSString*)s;
considering the input string as a floating point number, remove the trailing zeroes if is a non-integer number. This method should never be called with a number containing thousands separators but no decimal separator

addSeries: 

- (void) addSeries: (OKSeries*)series;
add the series

removeAllSeries 

- (void) removeAllSeries;
removes all current series

removeSeriesAtIndex: 

- (void) removeSeriesAtIndex: (NSUInteger)index;
removes the series identified by index

seriesAtIndex: 

- (OKSeries*) seriesAtIndex: (NSUInteger)index;
returns the series array identified by index

seriesCount 

- (NSUInteger) seriesCount;
Description forthcoming.

setAxisColor: 

- (IBAction) setAxisColor: (NSColor*)color;
Sets the chart axis and lines color

setBackgroundColor: 

- (IBAction) setBackgroundColor: (NSColor*)color;
Sets the graph background color

setGridColor: 

- (IBAction) setGridColor: (NSColor*)color;
Set the grid color

setGridStyle: 

- (IBAction) setGridStyle: (OKGridStyle)style;
grid drawing style according to OKGridStyle

setMarginBottom: 

- (void) setMarginBottom: (float)margin;
set bottom margin

setMarginLeft: 

- (void) setMarginLeft: (float)margin;
set left margin

setMarginRight: 

- (void) setMarginRight: (float)margin;
set right margin

setMarginTop: 

- (void) setMarginTop: (float)margin;
set Top margin

setXAxisGridSizing: 

- (void) setXAxisGridSizing: (OKGridSizing)sizing;
set gid sizing

setXAxisLabelStyle: 

- (void) setXAxisLabelStyle: (OKLabelStyle)style;
sets if and how axis labels are drawn

setYAxisGridSizing: 

- (void) setYAxisGridSizing: (OKGridSizing)sizing;
set gid sizing

setYAxisLabelStyle: 

- (void) setYAxisLabelStyle: (OKLabelStyle)style;
sets if and how axis labels are drawn

setYLabelNumberFormatting: 

- (void) setYLabelNumberFormatting: (OKNumberFormatting)fmt;
set label number formatting



Instance Variables for OKChart Class

axisColor

@protected NSColor* axisColor;
Description forthcoming.

backgroundColor

@protected NSColor* backgroundColor;
Description forthcoming.

graphMaxXVal

@protected float graphMaxXVal;
Description forthcoming.

graphMaxYVal

@protected float graphMaxYVal;
Description forthcoming.

graphMinYVal

@protected float graphMinYVal;
Description forthcoming.

gridColor

@protected NSColor* gridColor;
Description forthcoming.

gridStyle

@protected OKGridStyle gridStyle;
Description forthcoming.

marginBottom

@protected float marginBottom;
Description forthcoming.

marginLeft

@protected float marginLeft;
Description forthcoming.

marginRight

@protected float marginRight;
Description forthcoming.

marginTop

@protected float marginTop;
Description forthcoming.

seriesArray

@protected NSMutableArray* seriesArray;
Description forthcoming.

xAxisGridSizing

@protected OKGridSizing xAxisGridSizing;
Description forthcoming.

xAxisGridValues

@protected NSMutableArray* xAxisGridValues;
Description forthcoming.

xAxisLabelStyle

@protected OKLabelStyle xAxisLabelStyle;
Description forthcoming.

yAxisGridSizing

@protected OKGridSizing yAxisGridSizing;
Description forthcoming.

yAxisGridValues

@protected NSMutableArray* yAxisGridValues;
Description forthcoming.

yAxisLabelStyle

@protected OKLabelStyle yAxisLabelStyle;
Description forthcoming.

yLabelNumberFmt

@protected OKNumberFormatting yLabelNumberFmt;
Description forthcoming.




OKChart types

OKGridSizing

typedef enum ... OKGridSizing;
Description forthcoming.

OKGridStyle

typedef enum ... OKGridStyle;
Description forthcoming.

OKLabelStyle

typedef enum ... OKLabelStyle;
Description forthcoming.

OKNumberFormatting

typedef enum ... OKNumberFormatting;
Description forthcoming.