How to fit an equation containing more that one variables?

There is no “TGraph3D” in ROOT, so you will need to use a different approach, e.g.:

Another possibility would be to create a TH3? histogram and fit it with a TF3 fuction.