Rails 7 - Multiple series charts using Chartkick

110 Views Asked by At

I am new to Ruby on Rails development, and I am working on building charts is a Ruby on Rails application using Chartkick gem.

I am taking values from a form and storing the param values directly in the instance variables. I am then using those instance variables to plot graph.

I have three instance variables. Two of them (@usl and @lsl) contain integer values and @h contains a hash.

Below is the code I am running to plot the graph.

<%= line_chart([{name: "PROCESS_TIME_SAMPLES", data: @h.map{|t| [t.index, t] }}, {name: "USL", data: @usl},{name: "LSL", data: @lsl}]) %>

However, I can see that @usl and @lsl are not getting plotted in the graph. Only @h is getting plotted successfully as below.

enter image description here

0

There are 0 best solutions below