I am currently tackling a challenge involving displaying a graph that corresponds to the temperature of an object. My objective is to highlight sections of the line graph in red when the object's temperature is above 0, and in blue when it falls below zero.
The graph I am trying to create bears resemblance to the one found at this link: http://bl.ocks.org/pranitar/01305d9ad0eba73dbf80
While I have succeeded in changing the color of the graph, I am encountering difficulties in restricting the color change to specific segments based on the threshold values. Currently, the entire graph switches to red or blue as new data is input in real-time. It is important to note that the graph is dynamic, meaning that data is continuously fed into the graph, causing it to constantly evolve and display the line graph accordingly.
I would greatly appreciate any assistance or guidance in resolving this issue.
For this project, I am solely utilizing JS and CSS and would prefer not to entertain suggestions for additional frameworks. Thank you.