1.2.3-SNAPSHOT Arrow_down_16x16

area-chart*

incanter.charts

  • (area-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:1583 top

(defn area-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))
           main-title (or (:title opts) "")
	   theme (or (:theme opts) :default)
           _group-by (when (:group-by opts) 
		     (if (coll? (:group-by opts)) 
		       (to-list (:group-by opts))
		       ($ (:group-by opts) data)))
           x-label (or (:x-label opts) (str 'categories))
           y-label (or (:y-label opts) (str 'values))
	   series-label (:series-label opts)
           vertical? (if (false? (:vertical opts)) false true)
           legend? (true? (:legend opts))
           dataset (DefaultCategoryDataset.)
           chart (org.jfree.chart.ChartFactory/createAreaChart
                     main-title
                     x-label
                     y-label
                     dataset
                     (if vertical?
                       org.jfree.chart.plot.PlotOrientation/VERTICAL
                       org.jfree.chart.plot.PlotOrientation/HORIZONTAL)
                     legend?
                     true
                     false)]
        (do
          (doseq [i (range 0 (count _values))] 
	    (.addValue dataset
		       (nth _values i)
		       (cond 
			_group-by
			  (nth _group-by i)
			series-label
			  series-label
			:else
			  (str 'values))
		       (nth _categories i)))
          (set-theme chart theme)
	  chart))))
Vars in incanter.charts/area-chart*: cond defn doseq let nth str
Used in 0 other vars

Comments top

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