I use chartkick to create a multi-series ruler with the following code:
<%= line_chart [ {name: @track.name, data: records_of_track(@track).map{|record| [record.time_entered, record.entry]}}, {name: "Goal", data: [[@track.goal_by, @track.goal]]}, {name: "Goal trend line", data: [[most_recent_record(@track).time_entered, most_recent_record(@track).entry], [@track.goal_by, @track.goal]]} ]%>
And here is what it looks like:

The main idea is that blue is the material entered by the user, red is their goal, yellow connects the most recent user record with the goal in the form of a “trend line”. I wanted to set up a trend line so that I don’t have endpoints ( pointSize: 0 ) and be broken ( lineDashStyle: [5,5] ), but not the other two. I tried to do it
<%= line_chart [ {name: @track.name, data: records_of_track(@track).map{|record| [record.time_entered, record.entry]}}, {name: "Goal", data: [[@track.goal_by, @track.goal]]}, {name: "Goal trend line", data: [[most_recent_record(@track).time_entered, most_recent_record(@track).entry], [@track.goal_by, @track.goal]] , library: {pointSize: 0, lineDashStyle: [5,5]}} ]%>
but it didn’t work, as I got the same result as before and tried to do it
<%= line_chart [ {name: @track.name, data: records_of_track(@track).map{|record| [record.time_entered, record.entry]}}, {name: "Goal", data: [[@track.goal_by, @track.goal]]}, {name: "Goal trend line", data: [[most_recent_record(@track).time_entered, most_recent_record(@track).entry], [@track.goal_by, @track.goal]]} ] , library: {pointSize: 0, lineDashStyle: [5,5]} %>
but it made ALL lines dotted and all points disappeared as expected:

So, how do I make these attributes apply only to one curve, but not to the other two? If there is no direct implementation in the map market, it would also be useful to know how I could do this using only Google charts. While I get functionality!
-
EDIT 1: After looking at this , I tried to use the series parameter to change some parameter (here: lineWidth , since it was the easiest to type), but this also did not work, I received an error message. This was my code:
<%= line_chart [ {data: [[most_recent_record(@track).time_entered, most_recent_record(@track).entry], [@track.goal_by, @track.goal]]}, {name: @track.name, data: records_of_track(@track).map{|record| [record.time_entered, record.entry]}}, {name: "Goal", data: [[@track.goal_by, @track.goal]]} ] , library: library_settings %>
from
<% library_settings = { width: 600, vAxis: {ticks: choose_ticks(@track)}, colors: ['ff9900', '3366cc', 'dc3912'], series: { 0: {lineWidth: 1}, 1: {lineWidth: 2}, 2: {lineWidth: 10} } } %>
but i got an error
....html.erb:16: syntax error, unexpected ':', expecting => 0: {lineWidth: 1}, ^ ....html.erb:16: syntax error, unexpected ',', expecting keyword_end ....html.erb:17: syntax error, unexpected ',', expecting keyword_end ....html.erb:19: syntax error, unexpected '}', expecting keyword_end