(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))))
Used in 0 other vars
Comments top
No comments for add-categories*. Log in to add a comment.