How to use the data in the one-dimensional array to create a vtkXYPlotActor image?

I tried to set the value of each point with SetPointComponent, but it didn’t seem to work.
Or who knows how to use AddDataSetInput to input one-dimensional int array, please let me know, thank you!

        vtkSmartPointer<vtkXYPlotActor> histogramPlot =
            vtkSmartPointer<vtkXYPlotActor>::New();
//        histogramPlot->AddDataSetInput(ImageAccumulate->GetOutput());
        for(int i=0; i<pLen; i++){
            histogramPlot->SetPointComponent(i, value[i]);
            qDebug() << "SetPointComponent:" << histogramPlot->GetPointComponent(i);
        }