Chart real time data based on encoder input - length counter

I would like to show the real time data from sensors(y axis) based on encoder length counter input (x axis) and wanted to know how to do this.

You’ll have to use the classic Chart in XY Plot mode. Create your dataset with the x-axis values in the first column, and one or more y-axis values in the other columns.

The encoder length data is a float and I tried this previously and the dataset gave me errors as wrong data type.on the encoder for the x axis.