A quick search for "line chart" on this forum returns this recent discussion with examples on transforming the data using both a JS function and the JSONata expression evaluator.
As Colin says, posting a sample of your query results, and the current flow you are working on, will generally get better responses -- since we all like tweaking flows and code, and not so much spending time generating sample data or flows from a textual description...