QCustomPlot Discussion and Comments

Read access violation when I create a plotReturn to overview

My program can't create a simply plot.
This is my code:

QVector<QCPGraphData> timeData(size);

for(int i = 0; i< size; i++)
{
	QDateTime dt = QDateTime::fromString(myObject[i]->getDate() 
                                 + " " + myObject[i]->getTime(), "d/M/yyyy h:m:s");
	qDebug() << dt.toString();                  // "lun mag 10 09:00:26 2021"
	qDebug() << dt.currentSecsSinceEpoch();     // 1620894555
	timeData[i].key = dt.currentSecsSinceEpoch();
	timeData[i].value = listCounters[i]->getInserted();
}

plot->graph(0)->data()->set(timeData);

when I set the timeData to the plot, an exception is launched:
C:\Qt\5.15.2\msvc2019\include\QtCore\qsharedpointer_impl.h:326: error: Debugger encountered an exception: Exception at 0x74bbbd, code: 0xc0000005: read access violation at: 0x50, flags=0x0 (first chance)

I don't understand what is the problem, help me please!

I forgot to add: plot->addGraph()
I'm sorry