title: Line graph with glDrawArrays and GL_LINE_STRIP from vector
body: <p>How can I draw many lines with GL_LINE_STRIP, but not to draw a extra line between these lines, because it jumps to next value? See image</p>
  
  <p><a href="https://i.stack.imgur.com/o1nz2.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/o1nz2.jpg" alt="enter image description here"></a> </p>
  
  <p>Now the red lines are the actual values for the lines in the graph but the yellow ones are because it finished the values for line1 and goes on to next but still draw a line between these values. </p>
  
  <p>The code I'm using is like this: vector1 is containing all the line values.</p>
  
  <pre><code>glGenVertexArrays(1,&amp;Vector1_VAObject);
  glGenBuffers(1,&amp;Vector1_VBObject);
  
  glBindVertexArray(Vector1_VAObject);
  glBindBuffer(GL_ARRAY_BUFFER, Vector1_VBObject);
  
  glBufferData(GL_ARRAY_BUFFER,vector1.size()*sizeof(GLfloat), &amp;vector1[0] ,GL_STATIC_DRAW);
  glVertexAttribPointer(0,3,GL_FLOAT,GL_FALSE, 3*sizeof(GLfloat),(GLvoid*)0);
  //Clean
  glEnableVertexAttribArray(0);
  glBindBuffer(GL_ARRAY_BUFFER,0);
  glBindVertexArray(0);
  
  glUseProgram(lineShader-&gt;getProgram());
  glBindVertexArray(Vector1_VAObject);
  
  glDrawArrays(GL_LINE_STRIP,0,vector1.size());
  
  
  glBindVertexArray(0);
  </code></pre>
  
  <p>So my question is how can I fix this problem? So it loops through the vector and only draws the values for the lines and not when its is jumps after finish drawing first line..</p>