How to bucket on metric #A vs Average of #B in Grafana

I have 2 different Datasets against the TimeSeries coming from graphite, One dataset is size of the data processed and the other is the time took to process the data by workflow.

Dataset #A

Dataset #B


  • is JOB_NAME

I want to create buckets of #A against the average of #B in the TimeSeries manner.

Any help is appreciated.