title: line graph from a csv file without a header
body: <p>There is a csv file</p>
  <p><a href="https://i.stack.imgur.com/xaOhC.png" rel="nofollow noreferrer">screenshot</a></p>
  <p>where the first 2 columns are the date and time (according to the idea, time is written on the X axis), and all subsequent columns store the values on the Y axis. I want to build a line graph from it, and I can even do it using this <a href="https://www.createwithdata.com/chartjs-and-csv/" rel="nofollow noreferrer">example</a>, but only if I manually add column headers and column separators in the form of commas</p>
  <p><a href="https://i.stack.imgur.com/2K2ag.png" rel="nofollow noreferrer">screenshot 2</a></p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>function makeChart(dataSet) {
    console.log(dataSet);
    const time = dataSet.map(function (d) {
      return d.time;
    });
    const param = dataSet.map(function (d) {
      const v = [d.v1, d.v2, d.v3];
      return v[0];
    });
    const chart = new Chart("chart", {
      type: "line",
      options: {
        maintainAspectRatio: false,
        legend: {
          display: false,
        },
      },
      data: {
        labels: time,
        datasets: [
          {
            data: param,
          },
        ],
      },
    });
  }
  
  d3.csv("2022-07-09.csv").then(makeChart);</code></pre>
  </div>
  </div>
  </p>
  <p>Using the <a href="https://www.npmjs.com/package/csvjson" rel="nofollow noreferrer">csvjson</a> library, I can add these headers and split them into columns, but I don’t know how to display this on a chart</p>
  <p><div class="snippet" data-lang="js" data-hide="false" data-console="true" data-babel="false">
  <div class="snippet-code">
  <pre class="snippet-code-js lang-js prettyprint-override"><code>const fs = require("fs");
  const csvjson = require("csvjson");
  const path = require("path");
  
  const data = fs.readFileSync(path.join(__dirname, "2022-07-08.csv"), {
    encoding: "utf8",
  });
  
  const options = {
    delimiter: " ",
    quote: '"',
    headers: "date time amp1 amp2 amp3 v1 v2 v3",
  };
  const newData = csvjson.toObject(data, options);
  console.log(newData);</code></pre>
  </div>
  </div>
  </p>