Skip to content

kimim/re-echarts

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

12 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

https://clojars.org/re-echarts/latest-version.svg

https://img.shields.io/npm/v/echarts.svg

Example project: ./example

(ns starter.browser
  (:require
   [reagent.dom :as rdom]
   [re-echarts.core :refer [ECharts]]))

(defn myechart []
  [:> ECharts
      {:style {:width "800px" :height "600px"}
       :theme "dark"
       :option
       {:title {:text "Echarts is here"}
        :dataset {:dimention [:Week :Value]
                  :source [{:Week "Mon" :Value 820} {:Week "Tue" :Value 932} {:Week "Wed" :Value 901}
                           {:Week "Thu" :Value 934} {:Week "Fri" :Value 1220} {:Week "Sat" :Value 820}
                           {:Week "Sun" :Value 990}]}
        :xAxis {:type "category"}
        :yAxis {:type "value"}
        :series [{:type "line"
                  :smooth true}]}}])

(defn ^:dev/after-load start []
  (js/console.log "start")
  (rdom/render [#'myechart] (.getElementById js/document "app")))

(defn ^:export init []
  (js/console.log "init")
  (start))

(defn ^:dev/before-load stop []
  (js/console.log "stop"))

Deps: