1.2.3-SNAPSHOT permalink Arrow_down_16x16

set-stroke

incanter.charts

  • (set-stroke chart & options)

Examples:
(use '(incanter core charts))

(doto (line-chart [:a :b :c :d] [10 20 5 35])
(set-stroke :width 4 :dash 5)
view)

(doto (line-chart [:a :b :c :d] [10 20 5 35])
(add-categories [:a :b :c :d] [20 5 30 15])
(set-stroke :width 4 :dash 5)
(set-stroke :series 1 :width 2 :dash 10)
view)


(doto (function-plot sin -10 10 :step-size 0.1)
(set-stroke :width 3 :dash 5)
view)

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:2989 top

(defn set-stroke
"
  Examples:
    (use '(incanter core charts))

    (doto (line-chart [:a :b :c :d] [10 20 5 35])
      (set-stroke :width 4 :dash 5)
      view)
   
    (doto (line-chart [:a :b :c :d] [10 20 5 35])
      (add-categories [:a :b :c :d] [20 5 30 15])
      (set-stroke :width 4 :dash 5)
      (set-stroke :series 1 :width 2 :dash 10)
      view)


    (doto (function-plot sin -10 10 :step-size 0.1)
      (set-stroke :width 3 :dash 5)
      view)
       
"
([chart & options]
   (let [{:keys [width dash series dataset] 
	  :or {width 1.0 dash 1.0 series 0 dataset 0}} (apply hash-map options)
	 renderer (-> chart .getPlot (.getRenderer dataset))
	 stroke (java.awt.BasicStroke. width 
				       java.awt.BasicStroke/CAP_ROUND 
				       java.awt.BasicStroke/JOIN_ROUND 
				       1.0 
				       (float-array 1.0 dash) 
				       0.0)]
     (.setSeriesStroke renderer series stroke)
     chart)))
Vars in incanter.charts/set-stroke: defn let
Used in 0 other vars

Comments top

No comments for set-stroke. Log in to add a comment.