Reading data from CSV into separate traces


I am attempting to utilize Plotly (based on D3) to read through a CSV and return data into three separate traces - one for each year, in this case.

My hope is to create a chart such as depicted in this Codepen, but without the hard-coded data of sales data, by dealer and year.

I have researched a few examples of D3 reading CSV data but am unclear how to read my data into the separate traces by year.

Please note I also attempted to post at Stackoverflow as well.

I apologize that I am new to JavaScript in general. Please point me in the correct direction. Thank you!


Can you share a snippet of your CSV file to help us help you?


A sample of the CSV can be found @

Below are two of the examples I have been attempting to build upon:
Plotly example – reading CSV (
Plotly example – basic time series (

Thank you for any assistance or direction!


Here’s one way to do it:


This is exactly what I am looking for!

I then utilized ‘category order’ to order the x-axis values even with years that had no data.

Thank you for your help!