I am facing a challenge in modifying the background color of the rickshawgraph widget in dashing based on the maximum value of the highest graph from the latest incoming data. While I have successfully implemented this feature for one series, I am struggling to extend it to handle multiple series within a single graph. The code snippet below is extracted from the rickshawgraph.coffee file. I understand that I need to implement a loop to iterate through each series, identify the one with the highest value, and then proceed with the remaining logic. However, I'm encountering difficulties with the syntax. Any assistance would be greatly appreciated. The complete files are provided below.
node = $(@node)
series = @_parseData {points: @get('points'), series: @get('series')}
data = series[0].data
values = data[data.length - 1].y
cool = parseInt node.data "cool"
warm = parseInt node.data "warm"
...
The erb file where the widget is called:
...The scss file for rickshawgraph styling:
...The rickshawgraph.coffee code:
...The rickshawgraph.html code:
...