Skip to content

Commit

Permalink
candle example
Browse files Browse the repository at this point in the history
  • Loading branch information
awb99 committed Sep 27, 2024
1 parent 7555eeb commit bf461b0
Show file tree
Hide file tree
Showing 2 changed files with 38 additions and 6 deletions.
35 changes: 31 additions & 4 deletions demo/src/demo/page/highcharts.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -28,19 +28,23 @@
;; new version that provides :style and :class
[:p.bg-red-500.p-3 "NEW rtable.render.highcharts"]
[sample-selector
{:lg-new [highstock {:style {:width "1000px"
{:lg-new
[highstock {:style {:width "1000px"
:height "500px"}
:data highchart-spec}]
:annotation-new [highstock {:style {:width "500px"
:annotation-new
[highstock {:style {:width "500px"
:height "500px"}
:class "bg-red-300"
:data annotations/spec}]
:annotation-new-big [highstock {:style {:width "1000px"
:annotation-new-big
[highstock {:style {:width "1000px"
:height "500px"}
:class "bg-red-500"
:data annotations/spec}]

:chartspec [highstock-ds {:style {:width "1200px"
:chartspec
[highstock-ds {:style {:width "1200px"
:height "800px"
:border "3px solid green"}
:class "bg-red-500"
Expand All @@ -61,6 +65,29 @@
{:volume :column}
{:atr :column}]
:url "/r/bars-1m-full.transit-json"}]
:chartspec-candle
[highstock-ds {:style {:width "1200px"
:height "800px"
:border "3px solid green"}
:class "bg-red-500"
:charts [{:bar {:type :ohlc} ; :ohlc
:close {:type :line}
; band
:atr-band-mid {:type :point :color "orange"}
:atr-band-lower {:type :line :color "black"}
:atr-band-upper {:type :line :color "black"}
;pivots
;:p0-low {:type :step :color "red"}
;:p1-low {:type :step :color "red"} ; :step does not work with gaps.
;:pweek-low {:type :step :color "red"} ; :step does not work with gaps.
;:p0-high {:type :step :color "red"}
;:p1-high {:type :step :color "red"} ; :step does not work with gaps.
;:pweek-high {:type :step :color "red"} ; :step does not work with gaps.
}
{:volume :column}
{:atr :column}]
:url "/r/bars-1m-full.transit-json"}]


;
}]])
Expand Down
9 changes: 7 additions & 2 deletions src/rtable/render/highcharts_render.cljs
Original file line number Diff line number Diff line change
Expand Up @@ -64,11 +64,16 @@
(info "loading highchart extensions..")
(reset! loaded? true)
(add-debugger)
(add-boost)
(add-annotations)
(add-more)
(add-draggable-points)
(add-drag-panes)))
(add-drag-panes)
; Note: The Boost module should be included last.
; This is because it overrides both standard Highcharts functionality, and functionality
; in certain modules (namely treemap, heatmap, bubble, and scatter).
(add-boost)

))

(defn render-highchart [dom-node data]
(ensure-extensions-loaded)
Expand Down

0 comments on commit bf461b0

Please sign in to comment.