I can't link graph with table in Grafana

Help me please with the following problem.
I have a very simple table with two columns: Time (toStartOfHour(EVENT_DATE)) and Sum (SUM(if(MSG_TYPE = ‘DEFERRED’, 1, 0))) from my database. I want to create a graph with these two columns, where Y-axe will be ‘sum’ and X-axe will be ‘time’, but I don’t know how to do this. I created graph, but I can’t link it with table, so the result is incorrect.
Also I added screens from my table and graph settings.

Thank you in advance!