I have been trying to implement a graph in clojurescript , I am using c3.js library for the implementation and it’s failing to render the graph , I earlier got errors wrt c3.generate(), but even after resolving them the graph doesn’t show up
(defn new-chart[]
(println"Inside new chart ")
(let [c3-version (.-version js/c3)
_ (println c3-version)
config-map {:bindto "#chart"
:data {:columns
[["data1" 30 200 100 400 150 150]
["data2" 50 20 10 40 15 25]]
} }
_ (println "Config map "config-map)
myjs (clj->js config-map)]
(.generate js/c3 myjs)))
(defn rev-chartjs-component []
(reagent/create-class {:component-did-mount #(new-chart)
:display-name "chartjs-component"
:reagent-render (fn []
(println "Inside render function")
[:canvas {:id "#chart" :width "700" :height "380"}])}))
[rev-chartjs-component] ;;this is called inside a [:div]