This page is not created by, affiliated with, or supported by Slack Technologies, Inc.
2020-09-29
Channels
- # announcements (1)
- # babashka (120)
- # beginners (184)
- # cider (14)
- # clara (2)
- # clj-kondo (25)
- # cljfx (9)
- # cljsrn (43)
- # clojure (46)
- # clojure-australia (2)
- # clojure-berlin (5)
- # clojure-dev (2)
- # clojure-europe (10)
- # clojure-france (3)
- # clojure-nl (1)
- # clojure-spec (14)
- # clojure-uk (30)
- # clojurescript (50)
- # code-reviews (19)
- # conjure (11)
- # core-logic (2)
- # cursive (20)
- # datascript (1)
- # datomic (74)
- # figwheel-main (1)
- # fulcro (10)
- # funcool (2)
- # graphql (1)
- # lambdaisland (1)
- # malli (2)
- # meander (22)
- # nrepl (13)
- # off-topic (28)
- # overtone (3)
- # pathom (7)
- # pedestal (4)
- # re-frame (4)
- # reagent (16)
- # reitit (4)
- # releases (1)
- # ring (8)
- # shadow-cljs (93)
- # specter (6)
- # sql (13)
- # test-check (1)
- # tools-deps (1)
- # tree-sitter (2)
- # vim (8)
- # xtdb (25)
I have a XYChart with a line on it and i want to highlight the rightmost value of the line on the Y axis, how do I do something like this in FX? I realize this is probably kind of advanced and will require manually just drawing a shape on the screen. Any tips for doing stuff like that? If I have a shape, how do I "put it in the axis"? Here's what I'm looking to do:
I know this might not be very cljfx specific, hope it's ok to post some more general javafx stuff here, otherwise I can delete
hmm, don't really know, the closest thing I have in mind is showing the number on a data point itself:
{:fx/type :line-chart
:x-axis {:fx/type :number-axis}
:y-axis {:fx/type :number-axis}
:data [{:fx/type :xy-chart-series
:data
(let [data (->> 0
(iterate #(-> % (+ (rand)) (- 0.5)))
(take 50)
(map-indexed vector))]
(concat
(->> data
butlast
(map (fn [[i n]]
{:fx/type :xy-chart-data
:x-value i
:y-value n})))
[(let [[i n] (last data)]
{:fx/type :xy-chart-data
:node {:fx/type :label
:style {:-fx-font-size 10}
:text (format "%.2f" n)}
:x-value i
:y-value n})]))}]}