Common Lisp Package: NET.ACCELERATION.CHARTING

Charting library to make pretty graphs

README:

FUNCTION

Public

ADD-SERIES (LABEL DATA &KEY COLOR (MODE 'DEFAULT))

adds a series to the *current-chart*.

ADD-SLICE (LABEL VALUE &KEY COLOR)

add a slice to the pie

SAVE-FILE (FILENAME)

saves the *current-chart* to the given file.

SAVE-STREAM (STREAM)

saves the *current-chart* to the given stream.

SET-AXIS (AXIS TITLE &KEY DRAW-GRIDLINES-P (LABEL-FORMATTER #'DEFAULT-LABEL-FORMATTER) (MODE VALUE) DATA-INTERVAL SCALEFN DRAW-ZERO-P ANGLE)

set the axis on the *current-chart*. axis is either :x or :y. label-formatter is either a format-compatible control string or a function of 1 argument to control label formatting

Private

FIND-EXTREMES (DATA)

takes a list of (x y) pairs, and returns the ((x-min y-min) (x-max y-max))

Undocumented

DEFAULT-LABEL-FORMATTER (VALUE)

FIND-CHART-EXTREMES (CHART)

MAKE-POINT (X Y)

MACRO

Private

IF-LET ((VAR EXPR) IF-FORM ELSE-FORM)

Evaluates EXPR, binds it to VAR, and uses VAR as the first argument to IF, executing the if-form or else-form depending on VAR

WHEN-LET ((VAR EXPR) &BODY BODY)

Evaluates EXPR, binds it to VAR, and executes BODY if VAR has a true value.

WITH-COLOR-STACK (NIL &BODY BODY)

resets *color-stack* to the initial list

GENERIC-FUNCTION

Private

DRAW-CHART (CHART)

draws the chart, assuming a vecto canvas is open

SAVE-CHART-TO-FILE (FILENAME CHART)

saves the chart to the given file

SAVE-CHART-TO-STREAM (STREAM CHART)

saves the chart to the given stream

Undocumented

AXIS-LABEL (AXIS DATA)

CLONE (P)

COLOR (OBJECT)

SLOT-ACCESSOR

Private

DATA (OBJECT)

a list of (x y) pairs (as lists, not cons cells)

SETFDATA (NEW-VALUE OBJECT)

a list of (x y) pairs (as lists, not cons cells)

DRAW-GRIDLINES-P (OBJECT)

determines if grid-lines are drawn across the chart

SETFDRAW-GRIDLINES-P (NEW-VALUE OBJECT)

determines if grid-lines are drawn across the chart

DRAW-ZERO-P (OBJECT)

Should we draw a line along the 0 of this axis?

SETFDRAW-ZERO-P (NEW-VALUE OBJECT)

Should we draw a line along the 0 of this axis?

LABEL (OBJECT)

description of this axis, usually the unit of measurement ($, s, km, etc)

SETFLABEL (NEW-VALUE OBJECT)

description of this axis, usually the unit of measurement ($, s, km, etc)

LABEL-FORMATTER (OBJECT)

a function to format data points, for printing periodic values along the axis

SETFLABEL-FORMATTER (NEW-VALUE OBJECT)

a function to format data points, for printing periodic values along the axis

MODE (OBJECT)

a flag for how to render this series

SETFMODE (NEW-VALUE OBJECT)

a flag for how to render this series

SCALEFN (OBJECT)

Values will be passed through this function for scaling prior to display

SETFSCALEFN (NEW-VALUE OBJECT)

Values will be passed through this function for scaling prior to display

Undocumented

ANGLE (OBJECT)

SETFANGLE (NEW-VALUE OBJECT)

BACKGROUND (OBJECT)

SETFBACKGROUND (NEW-VALUE OBJECT)

CHART-ELEMENTS (OBJECT)

SETFCHART-ELEMENTS (NEW-VALUE OBJECT)

SETFCOLOR (NEW-VALUE OBJECT)

DATA-INTERVAL (OBJECT)

SETFDATA-INTERVAL (NEW-VALUE OBJECT)

DRAW-LEGEND-P (OBJECT)

SETFDRAW-LEGEND-P (NEW-VALUE OBJECT)

HEIGHT (OBJECT)

SETFHEIGHT (NEW-VALUE OBJECT)

LABEL-SIZE (OBJECT)

SETFLABEL-SIZE (NEW-VALUE OBJECT)

MARGIN (OBJECT)

SETFMARGIN (NEW-VALUE OBJECT)

VALUE (OBJECT)

SETFVALUE (NEW-VALUE OBJECT)

WIDTH (OBJECT)

SETFWIDTH (NEW-VALUE OBJECT)

X (OBJECT)

SETFX (NEW-VALUE OBJECT)

Y (OBJECT)

SETFY (NEW-VALUE OBJECT)

VARIABLE

Private

*CURRENT-CHART*

The currently active chart. Bound for the duration of WITH-CHART.

+DEFAULT-COLORS+

rgb 0-1.0 triples

Undocumented

*COLOR-STACK*

CLASS

Private

AXIS

represents an axis on a line chart

CHART-ELEMENT

this is a super-class for various chart elements

SERIES

represents a line on a line chart

SLICE

this is a slice of a pie chart

Undocumented

AREA

CHART

POINT