Created
March 20, 2020 14:00
-
-
Save gmp26/649cdb1cb1a49c9ec75f619afcf4a18d to your computer and use it in GitHub Desktop.
Clone of react-chartjs-2 line example
This file contains 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 characters
(ns covid.charts.deaths | |
(:require | |
["react-chartjs-2" :refer (Line)] | |
[reagent.core :as r] | |
[re-frame.core :as rf] | |
[covid.subs :as subs])) | |
(def data {:labels ["January" "February" "March" "April" "May" "June" "July"] | |
:datasets [{:label "My First dataset" | |
:fill false | |
:lineTension 0.1 | |
:backgroundColor "rgba(75,192,192,0.4)" | |
:borderColor "rgba(75,192,192,1)" | |
:borderCapStyle "butt" | |
:borderDash [] | |
:borderDashOffset 0.0 | |
:borderJoinStyle "miter" | |
:pointBorderColor "rgba(75,192,192,1)" | |
:pointBackgroundColor "#fff" | |
:pointBorderWidth 1 | |
:pointHoverRadius 5 | |
:pointHoverBackgroundColor "rgba(75,192,192,1)" | |
:pointHoverBorderColor "rgba(220,220,220,1)" | |
:pointHoverBorderWidth 2 | |
:pointRadius 1 | |
:pointHitRadius 10 | |
:data [65 59 80 81 56 55 40]}]}) | |
(defn line-example [] | |
[:div {:style {:width 500}} | |
[:h2 "Line Example"] | |
[:> Line {:data data}]]) | |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Turned out to be simple - no need to convert Line parameters to #js
