Function: chart-add-sequence

chart-add-sequence is a byte-compiled function defined in chart.el.gz.

Signature

(chart-add-sequence ARG &rest ARGS)

Implementations

((c chart) &optional seq axis-label) in `chart.el'.

Add to chart object C the sequence object SEQ. If AXIS-LABEL, then the axis stored in C is updated with the bounds of SEQ, or is created with the bounds of SEQ.

Source Code

;; Defined in /usr/src/emacs/lisp/emacs-lisp/chart.el.gz
(cl-defmethod chart-add-sequence ((c chart) &optional seq axis-label)
  "Add to chart object C the sequence object SEQ.
If AXIS-LABEL, then the axis stored in C is updated with the bounds of SEQ,
or is created with the bounds of SEQ."
  (if axis-label
      (let ((axis (eieio-oref c axis-label)))
	(if (stringp (car (oref seq data)))
	    (let ((labels (oref seq data)))
	      (if (not axis)
		  (setq axis (make-instance 'chart-axis-names
					    :name (oref seq name)
					    :items labels
					    :chart c))
		(oset axis items labels)))
	  (let ((range (cons 0 1))
		(l (oref seq data)))
	    (if (not axis)
		(setq axis (make-instance 'chart-axis-range
					  :name (oref seq name)
					  :chart c)))
            (dolist (x l)
              (if (< x (car range)) (setcar range x))
              (if (> x (cdr range)) (setcdr range x)))
            (oset axis bounds range)))
	(if (eq axis-label 'x-axis) (oset axis loweredge nil))
	(eieio-oset c axis-label axis)
	))
  (oset c sequences (append (oref c sequences) (list seq))))