0
votes

It doesn’t seem like graphite supports changing the y-axis labels to percentages on line charts, but they support it on pie charts, oddly enough: https://graphite.readthedocs.io/en/latest/render_api.html?highlight=y-axis#valuelabels

I looked at the meta data from an svg formatted image. Surely enough they have a y.labels array for y-axis, but you can’t modify it through their Render URL API as a parameter??

"y": {
        "labelValues": [0, 0.25, 0.5, 0.75, 1.0],
        "labels": ["0 ", "0.25 ", "0.50 ", "0.75 ", "1.00  "],
        "step": 0.25
      }

Any thoughts? Here’s their documentation on all the y-axis parameters: https://graphite.readthedocs.io/en/latest/render_api.html?highlight=y-axis#yaxisside

Here's what I currently have:

/render?target=asPercent(node.load_avg.one,1)&format=png&yMax=100&yStep=25

This takes the node load average and return percentages. For example, if a value was 0.75 it would convert it to 75. However, the y-axis does not display "%" character next to the ySteps. A small thing, but it would be nice if I could make it say 75% instead of 75...

Here's what I want:

"y": {
        "labelValues": [0, 25, 50, 75, 100],
        "labels": ["0%", "25%", "50%", "75%", "100%"],
        "step": 25
      }
1

1 Answers

0
votes

Seems you are right. I expect this is easy to implement. I don't have time at the moment but if you want to give it a try I can review your PR and/or give some hints.