Somehow, the color values displayed with the linear gradient don't match up with the real values displayed in the graph.
The included linear gradient example looks like the following (tested in Firefox and Chrome on Windows 11):

The gradient is supposed to match the altitude, so the deepest red color should be at the highest point, but it isn't.
Another example with my own code and own track, but same color config:

It is a bit more subtle here, but the deep red part is still not at the highest point. Noticable in both images is also the location of the color yellow. In both images, there are two occurrences of yellow, but on two totally different heights in each image.
I have also noticed similar issues when using slope instead of altitude, but it is more difficult to see there, because with slope, there is another issue:
min- and max-values of the gradient can only be set as string-indices for track_data. Thus, the gradient is always relative to the min- and max-values of the track. This, however, is quite impractical when trying to display a slope gradient, because there you typically want fixed constants as min and max, independent of the specific tracks.
Somehow, the color values displayed with the linear gradient don't match up with the real values displayed in the graph.

The included linear gradient example looks like the following (tested in Firefox and Chrome on Windows 11):
The gradient is supposed to match the altitude, so the deepest red color should be at the highest point, but it isn't.
Another example with my own code and own track, but same color config:

It is a bit more subtle here, but the deep red part is still not at the highest point. Noticable in both images is also the location of the color yellow. In both images, there are two occurrences of yellow, but on two totally different heights in each image.
I have also noticed similar issues when using slope instead of altitude, but it is more difficult to see there, because with slope, there is another issue:
min- and max-values of the gradient can only be set as string-indices for track_data. Thus, the gradient is always relative to the min- and max-values of the track. This, however, is quite impractical when trying to display a slope gradient, because there you typically want fixed constants as min and max, independent of the specific tracks.