Created
June 7, 2016 20:43
-
-
Save edwthomas/08482a18a4aaf8655dc80f29f15beeef to your computer and use it in GitHub Desktop.
Revisions
-
edwthomas created this gist
Jun 7, 2016 .There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters. Learn more about bidirectional Unicode charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,20 @@ (:require [re-frame.core :as re-frame] [reagent.core :as reagent] [cljsjs.chartist]) (defn show-chart [] (let [chart-data {:labels ["Mar-2012" "Jun-2012" "Nov-2012" "Oct-2013" "Nov-2014"] :series [[1 1 6 15 25]]} options {:width "700px" :height "380px"}] (js/Chartist.Line. ".ct-chart" (clj->js chart-data) (clj->js options)))) (defn chart-component [] (let [some "state goes here"] (reagent/create-class {:component-did-mount #(show-chart) :display-name "chart-component" :reagent-render (fn [] [:div {:class "ct-chart ct-perfect-fourth"}])})))