[Grafana/Prometheus] Legend Format Type Convertion

Hi All,
The problem I am having is that the label value type stored in my Prometheus is String. Therefore, when I pick the label as legend format in Grafana. The x-axis of the graph is not ordered numerically. Is there anyway that I can convert the label/legend format to Integer in Grafana without changing label value type in Prometheus?