styd / apexcharts.rb

:bar_chart: Awesome charts for your ruby app powered by ApexCharts.JS.
https://a-styd.gitbook.io/apexcharts-ruby/
MIT License
481 stars 29 forks source link

Syncing candlestick charts #76

Open migore opened 3 years ago

migore commented 3 years ago

Is your feature request related to a problem? Please describe. I'm trying to use the sync functionality with a candlestick chart but the candlestick chart is not rendered. I can successfully display both charts without sync. If I try to sync two line_charts it works as well.

Describe the solution you'd like The candlestick chart rendered and synced with the other charts.

Additional context I'm using Sinatra. Sample code that I'm using:

  def sync_candles_macd
    syncing_charts(chart: {toolbar: false}, height: 250, style: 'display: inline-block; width: 32%;') do
      line_chart(@macd_data, @macd_options) # these two line charts are rendered and synced
      line_chart(@macd_data, @macd_options) 
      candlestick_chart(@data, @data_options)
    end 
  end

The index template:

  template :index do
    <<~INDEX
      <script src="https://cdn.jsdelivr.net/npm/apexcharts"></script>
      <%= sync_candles_macd %>
    INDEX
  end

Note: TY for the awesome project! :)

styd commented 3 years ago

If it works in apexcharts js and not in this gem, then it should be a bug. Thanks for reporting this, I'll look into it later.