Problem with drawing text


« 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 Antonio Vianello on 11th November 2013
Hi there!

When I try to draw text on a simple bar chart like this:

var x = bar.canvas.width / 2;
var y = bar.Get('gutter.top') - 5;
        
var text = new RGraph.Drawing.Text('cvs', x, y, 'An example of the drawing API text object')
.Set('valign', 'bottom')
.Set('halign', 'center')
.Set('size', 14)
.Set('tooltips', ['The drawing API text object'])
.Set('tooltips.event', 'mousemove')
.Set('highlight.stroke', 'rgba(0,0,0,0)')
.Draw();

I get the following javascript error:

"Uncaught Type Error: Cannot read property 'Text' of undefined"

I correctly include all the relative libraries, expecially the drawing API, so I cannot figure out what is the problem.

Thanks in advance
Posted by RGraph Support on 11th November 2013
Hi there,

The page is saying that RGraph.Drawing is undefined - so it looks like you haven't included the drawing API. If you think you have then you might have a 404, Try going to the URL of the JavaScript file directly in your browser - eg:

www.foo.com/javascript/RGraph.drawing.text.js




Richard, RGraph Support
Please remember to link to the RGraph website

Help support RGraph - single site license only £99
    www.rgraph.net/license#single-site

Add a reply

 




« Back to message list
RGraph on social media