Search code examples
jqueryraphaelgraphael

r.g is undefined in graphael?


Based on the graphael documentation I am supposed to draw charts like this:

var r =Raphael('blah');
var chart = r.hbarchart(...);

Then I attempted to add a gradient and saw people doing like this:

var r = Raphael('blah');
var chart = r.g.hbarchart(...);

chart.shades[0].attr({...});

I tried:

chart.shades[0].attr({...});

but the browser complained that chart.shades is undefined. So I decided maybe if I change r.hbarchart({...}); into r.g.hbarchart({...}); it will work.

However, now it says r.g is undefined.


Solution

  • Yes the same problem I faces some days ago..and couldn't reach any valid conclusion..

    But in order to get it working what you can do is download the repo on github I am giving link and include those libs which are in the repo and follow the examples in the repo..you'll be able to use r.g...

    Repo on github with all working deomos..

    The reason I could understand is that they have changed r.g to r. for all types of graphs and normal vector images..thats why we can't use r.g....and irony is that we can't use the other advanced features like label, shades with r.