There are two possible reasons for this using the "line chart" visualization. Both issues can be resolved by switching to a different visualization type, either Lens or TSVB.
a. The index pattern that you are visualizing is missing a primary time field
b. The primary time field on the index pattern is not the same time field that you are visualizing
For the "line chart" visualization it's recommended to use the primary time field. For other visualizations you can use any time field.