1. Steffen Dienst
  2. chart-utils


Steffen Dienst  committed 8bb7e53

[feature] set new data for heatmaps
Can't use incanter.core/set-data, since this dispatches only on the type
of the chart, not of the renderer/dataset

  • Participants
  • Parent commits 76c36cc
  • Branches master

Comments (0)

Files changed (1)

File src/chart_utils/jfreechart.clj

View file
       (.setPaintScale r scale))
     (when (instance? org.jfree.chart.title.PaintScaleLegend l) 
       (.setScale l scale))))
+(defn set-heatmap-data [chart ^org.jfree.data.xy.DefaultXYZDataset data]
+  (let [ds (.. chart getPlot getDataset)
+        sk (.getSeriesKey ds 0)]
+    (doto ds 
+      (.removeSeries sk)
+      (.addSeries sk data)))) 
 (defn heat-map*
   ([function x-min x-max y-min y-max & options]