Can I show the Percentage in the Legend of a Graph panel using ElasticSearch?

I have a pretty simple scenario: I’m displaying the rate of a certain event based on an ElasticSearch query in a Graph panel. I’m grouping the graph by a certain term.
The graph shows the lines properly, and in the Legend I can display the total number of the events under the various groups:

Is there a way I could also show the percentages of the values in the Legend? Since there is no such option under Legend in the Visualization configuration, I assume that the Graph panel doesn’t support it built-in, but is there maybe some trick or workaround with the ElasticSearch query which could make this possible?

I don’t think it’s possible. I would be interested if someone can manage to implement this in the graph-panel.

An alternative way if implementing this would be to use the PieChart plugin.
It has exactly that option by default.