title: How to use lines instead of bars in tradingview
body: <p>Im using tradingview charting library and providing own data with JS API. After getting data from a server, I run the following inside the &quot;getBars&quot;-function:</p>
  <pre><code>const data = fetch_data_from_an_api();
  let bars = [];
  data.Data.forEach(bar =&gt; {
      if (bar.time &gt;= from &amp;&amp; bar.time &lt; to) {
          bars = [...bars, {
              time: bar.time * 1000,
              low: bar.low,
              high: bar.high,
              open: bar.open,
              close: bar.close,
          }];
      }
  });
  onHistoryCallback(bars, {
      noData: false,
  });
  </code></pre>
  <p>Each element in the array can look like this:</p>
  <pre><code>time: 1459814400,
  close: 424.53,
  high: 425,
  low: 419.61,
  open: 420.01,
  volumefrom: 7219.7,
  volumeto: 3052754.53,
  conversionType: &quot;force_direct&quot;,
  conversionSymbol: &quot;&quot;
  </code></pre>
  <p>This draws bars in the widget. But they are &quot;candles&quot;, because there is &quot;close, open, low, high&quot;.
  In my case, I have my own data (the data above is fetched from another example-api) which only contains the &quot;close&quot;. So the bars don't make sense in my graph. I want to draw lines instead of having bars.
  I attach here how it looks like when there are bars:</p>
  <p><a href="https://i.stack.imgur.com/qkcLh.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/qkcLh.png" alt="Widget with bars" /></a></p>
  <p>And I attach here how it looks like when I have the same value for &quot;close, open, low, high&quot;. As you can see it only prints some kind of dots, but they do not form a line. I also tried to only put the &quot;close&quot; in the array of bars, but then the graph becomes empty.</p>
  <p><a href="https://i.stack.imgur.com/g7YVe.png" rel="nofollow noreferrer"><img src="https://i.stack.imgur.com/g7YVe.png" alt="Wished lines" /></a></p>