Function: chart-bar-quickie
chart-bar-quickie is a byte-compiled function defined in chart.el.gz.
Signature
(chart-bar-quickie DIR TITLE NAMELST NAMETITLE NUMLST NUMTITLE &optional MAX SORT-PRED)
Documentation
Create a bar chart named TITLE in direction DIR [horizontal vertical].
NAMELST is the list of bar names and NAMETITLE is the name the of axis
containing them.
NUMLST is the list of values and NUMTITLE is the name of the value
axis.
Optional argument MAX limits the chart's max element display to MAX by
passing it as second argument to chart-trim, otherwise the chart's
display is unlimited.
Optional argument SORT-PRED is a predicate function passed as second
argument to chart-sort to sort the lists if desired.
Source Code
;; Defined in /usr/src/emacs/lisp/emacs-lisp/chart.el.gz
;;; Helpful `I don't want to learn eieio just now' washover functions
(defun chart-bar-quickie (dir title namelst nametitle numlst numtitle
&optional max sort-pred)
"Create a bar chart named TITLE in direction DIR [`horizontal' `vertical'].
NAMELST is the list of bar names and NAMETITLE is the name the of axis
containing them.
NUMLST is the list of values and NUMTITLE is the name of the value
axis.
Optional argument MAX limits the chart's max element display to MAX by
passing it as second argument to `chart-trim', otherwise the chart's
display is unlimited.
Optional argument SORT-PRED is a predicate function passed as second
argument to `chart-sort' to sort the lists if desired."
(let ((nc (make-instance 'chart-bar
:title title
:key-label "8-m" ; This is a text key pic
:direction dir
))
(iv (eq dir 'vertical)))
(chart-add-sequence nc
(make-instance 'chart-sequence
:data namelst
:name nametitle)
(if iv 'x-axis 'y-axis))
(chart-add-sequence nc
(make-instance 'chart-sequence
:data numlst
:name numtitle)
(if iv 'y-axis 'x-axis))
(if sort-pred (chart-sort nc sort-pred))
(if (integerp max) (chart-trim nc max))
(switch-to-buffer (chart-new-buffer nc))
(chart-draw nc)))