In this paper, we introduce the Fubini number and Fubini polynomial of a graph in connection with the enumeration of ordered independent partitions of its set of vertices. We prove several properties of them, and study how these notions cover other variants of Fubini numbers and polynomials for special graphs.