Skip to content

daru_chart and daru_table in Rails app

Shekhar Prasad Rajak edited this page Aug 23, 2017 · 1 revision

When we created a sample rails app with the daru-view and daru-io, this comment came up with a good idea of daru_chart and daru_table rather than using Daru::View::Plot.new(..).div, Daru::View::Table.new(..).div and raw in rails app.

To implement the idea in daru-view PR https://github.com/Shekharrajak/daru-view/pull/55 created and changes happened in the sample rails app with this PR https://github.com/Shekharrajak/daru_examples_io_view_rails/pull/13

So now we can do something like this directly in rails app to get the html code of the chart or table :

for table :

<%= daru_table(data, options) %>

for chart :

<%= daru_table(data, options) %>

Parameters data and options can be same as Daru::View::Plot and Daru::View::Table .

Clone this wiki locally