1.2.3-SNAPSHOT Arrow_down_16x16

add-categories*

incanter.charts

  • (add-categories* chart categories values & options)

0 Examples top

Log in to add / edit an example.

See Also top

Log in to add a see also.

Plus_12x12 Minus_12x12 Source incanter/charts.clj:391 top

(defn add-categories*
  ([chart categories values & options]
    (let [opts (when options (apply assoc {} options))
	  data (:data opts)
	  _values (if (coll? values) (to-list values) ($ values data))
	  _categories (if (coll? categories) (to-list categories) ($ categories data))
	  _group-by (when (:group-by opts) 
		      (if (coll? (:group-by opts)) 
		       (to-list (:group-by opts))
		       ($ (:group-by opts) data)))
           _chart chart
	   series-label (:series-label opts)
           data-plot (.getCategoryPlot _chart)
           n-col (.getColumnCount (.getDataset data-plot))
           n-row (.getRowCount (.getDataset data-plot))]
        (do
          (doseq [i (range 0 (count _values))] (.addValue (.getDataset data-plot)
                                                      (nth _values i)
                                                      (cond 
						       _group-by
                                                         (nth _group-by i)
						       series-label
						         series-label
						       :else
                                                         (str 'values))
                                                       (nth _categories i)))
          chart))))
Vars in incanter.charts/add-categories*: cond defn doseq let nth str
Used in 0 other vars

Comments top

No comments for add-categories*. Log in to add a comment.