Getting error message: "RGraph.Line is not a constructor"

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« Back to message list

Enter your email address to get email updates on this topic. You can stop receiving updates by clicking the link in the update email messages.

Posted by Martin on 16th May 2014
I get this error 'RGraph.Line' is not a constructor

here is my code:

script>
  window.onload = function ()
     {
     var line = new RGraph.Line('cvs2', [4512, 4512, 4272, 4512, 4512, 4272, 4272, 4512, 4512, 4272, 4272, 4512, 4512, 4272, 4272, 4512, 4512, 4272, 4272, 4512, 4512, 4512, 4272, 4272, 4512, 4512, 4272, 4512, 4512, 4272, 4272])
         .set('spline', true)
         .set('numxticks', 11)
         .set('numyticks', 5)
         .set('background.grid.autofit.numvlines', 11)
         .set('colors', ['red'])
         .set('linewidth', 5)
         .set('gutter.left', 40)
         .set('gutter.right', 15)
         .set('labels', ['2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15', '2013-12-15'])
         .set('shadow',true)
         .set('shadow.color','#aaa')
         .set('shadow.blur',5)
         .set('tickmarks',null)
         .draw();
     }
</script>

<canvas id="cvs2" width="450" height="250">Error.</canvas>


Thank you for help.
Posted by Richard on 16th May 2014
It sounds like you've forgot to include the line chart library file.




Richard
Posted by Martin on 16th May 2014
Thanks, i forgot that because i had already bar chart on that page.

Add a reply




« Back to message list