1.2.3-SNAPSHOT permalink Arrow_down_16x16



  • (add-points* chart x y & 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:652 top

(defn add-points*
  ([chart x y & options]
    (let [opts (when options (apply assoc {} options))
	  data (:data opts)
	  _x (if (coll? x) (to-list x) ($ x data))
	  _y (if (coll? y) (to-list y) ($ y data))
	  data-plot (.getPlot chart)
	  n (.getDatasetCount data-plot)
	  series-lab (or (:series-label opts) (format "%s, %s" 'x 'y))
	  data-series (XYSeries. series-lab)
	  line-renderer (XYLineAndShapeRenderer. false true)
	  data-set (XYSeriesCollection.)]
	(doseq [i (range (count _x))] (.add data-series (nth _x i)  (nth _y i)))
	(.setSeriesRenderingOrder (.getPlot chart) org.jfree.chart.plot.SeriesRenderingOrder/FORWARD)
	(.setDatasetRenderingOrder (.getPlot chart) org.jfree.chart.plot.DatasetRenderingOrder/FORWARD)
	(.addSeries data-set data-series)
	(.setDataset data-plot n data-set)
	(.setRenderer data-plot n line-renderer)
Vars in incanter.charts/add-points*: defn doseq let nth
Used in 0 other vars

Comments top

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