Hi, I'm making a website with ClojureScript, React, Bootstrap, and Apex Charts. This…
- User
Hi, I'm making a website with ClojureScript, React, Bootstrap, and Apex Charts. This chart isn't working properly for me:
(def approved-invoice-chart [ApexChart {:options (clj->js {:chart {:id "invoice-chart"} :plotoptions {:radialbar {:hollow {:size "60%"}}} :colors (util/colours :teal)}) :labels ["Cricket"] :series (clj->js [{:name "Approved Invoices" :data [83]}]) :type "radialBar" :width 500 :height 400}])
In the chart it says [Object object] % and the data is not being read
- Assistant
The problem in your ClojureScript code seems to relate to a mismatch in how you're specifying the chart configuration, particularly around the series data structure and potentially the configuration keyword. Also, there's a typo in the key (it should be written as not ). Let's address these issues:
- User
Here's how it is currently:
(def approved-invoice-chart [:div [ApexChart {:options (clj->js {:chart {:id "invoice-chart"} :plotOptions {:radialBar {:hollow {:size "60%"}}} ; make the bar thinner :title {:text "Approved Invoices" :align "left"} :labels [""] ; blank out the default apex chart label :colors (colours :orange-dark)}) :series [83] :type "radialBar" :width 500 :height 400}] [:p "Hello"]])
This is the spec:
Do it as the % of actual revenue vs the estimated revenue Put a $ total on the chart if possible Total Estimate Revenue Total Actual Revenue Total Left to Invoice
Is it possible to modify the chart to include these? Or am I better off overlaying them behind the chart in an overlapping div?
- Assistant