Skip to content

Commit

Permalink
Fixed Charts building issue (#39)
Browse files Browse the repository at this point in the history
  • Loading branch information
dinesh-skyach authored and yivo committed May 23, 2018
1 parent 239e375 commit 92e764d
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions app/assets/javascripts/component_ui/candlestick.js.coffee
Original file line number Diff line number Diff line change
Expand Up @@ -428,10 +428,13 @@ INDICATOR = {MA: false, EMA: false}
@updateByTrades = (event, data) ->
chart = @$node.find('#candlestick_chart').highcharts()

if @liveRange(chart)
@process(chart, data)
if chart.series[0].points.length > 0
if @liveRange(chart)
@process(chart, data)
else
@running = false
else
@running = false
@trigger "switch::range_switch::init" # reintialize chart when having no data

@liveRange = (chart) ->
p1 = chart.series[0].points[ chart.series[0].points.length-1 ].x
Expand Down

0 comments on commit 92e764d

Please sign in to comment.