This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2015-08-06
Channels
- # admin-announcements (2)
- # beginners (7)
- # boot (99)
- # cider (2)
- # cljs-dev (50)
- # clojure (58)
- # clojure-austin (3)
- # clojure-australia (9)
- # clojure-berlin (8)
- # clojure-china (1)
- # clojure-dev (15)
- # clojurescript (183)
- # clojutre (2)
- # clr (1)
- # cursive (106)
- # datomic (25)
- # editors (5)
- # incanter (21)
- # ldnclj (47)
- # off-topic (11)
- # om (8)
- # overtone (5)
- # re-frame (28)
- # reagent (12)
- # testing (7)
Hello, could someone help me with changing colors of histogram's DataSeries? I've following code:
(let [plot (histogram (sample-normal 20))
_ (add-histogram plot (sample-normal 20))
render (-> plot .getPlot .getRenderer)]
(.setSeriesOutlinePaint render 1 java.awt.Color/BLUE)
(.setSeriesFillPaint render 1 java.awt.Color/BLUE)
(view plot))
and while it changes outline color correctly, the fill paint remains unchanged. šwhat happens when you use .setSeriesPaint
like set-stroke-color
does? https://github.com/incanter/incanter/blob/3f8ef1e24ee31b4cfa27a191eec95c3486afa81d/modules/incanter-charts/src/incanter/charts.clj#L3616 @arathunku
Nothing changes. I've read that add-histogram returns new chart so I tried it with the following code
(let [base-plot (histogram (sample-normal 20))
plot (add-histogram base-plot (sample-normal 20))
render (-> plot .getPlot (.getRenderer 0))]
(.setSeriesOutlinePaint render 1 Color/BLUE)
(.setSeriesPaint render 1 Color/BLUE)
(view plot))
@arathunku: Perhaps try .setBaseFillPaint
But Iām not confident in that
Oh, but you want the second series
I've fighting with this for few hours and can't get this working so I'm writing a wrapper around http://xeiam.com/xchart-example-code/ Simpler API, enough for my needs and clojure wrapper might be useful for community in the future.
@arathunku: did you try .setPaint
already?
well, tbh I don't ever use the jfreechart stuff. I ran into similar issues in the past š
otherwise let me know how it goes with the xchart wrapper and don't forget dropping a link to the repo over here
if you find time to open an issue on github, that would be great, too. I will look a bit more into this once I find the time myself