Fork me on GitHub
#helix
<
2022-05-27
>
Ahmed Hassan17:05:03

https://ej2.syncfusion.com/react/demos/#/bootstrap5/chart/line I'm trying to translate this code into helix, but only grid is showing and lines for data1 and data2 are not showing.

lilactown17:05:27

cljs vectors (created using [] syntax) and maps (created using {} syntax) are not the same as JS arrays and objects

💯 1
lilactown17:05:41

so your data1 and data2 are created using CLJS vectors and maps and the chart components probably don't know how to read them

💯 1
lilactown17:05:55

you can write JS arrays and objects using the #js reader tag, e.g.

(def data1
  #js [#js {:x (js/Date. 2005 0 1) :y 21}
       #js {:x (js/Date. 2006 0 1) :y 24}
       #js {:x (js/Date. 2007 0 1) :y 36}
       #js {:x (js/Date. 2008 0 1) :y 38}
       #js {:x (js/Date. 2009 0 1) :y 54}
       #js {:x (js/Date. 2010 0 1) :y 57}
       #js {:x (js/Date. 2011 0 1) :y 70}])

💯 1
Ahmed Hassan17:05:56

Thanks, It works. I also had to do similar to the CLJS vector of services:

($ Inject {:services #js [LineSeries, DateTime, Legend, Tooltip]})

1
🙌 1