Problem with grow() Bar chart


« 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 Ruben on 7th May 2014
Hi,

I am trying to do this effect with .grow():

www.rgraph.net/demos/effects-bar-grow.html

This is right:

var data = [4,8,6,3,1,2,5,8,9];
var bar = new RGraph.Bar('cvs', data)
.set('labels',['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
.draw();



This is wrong:

var data = [4,8,6,3,1,2,5,8,9];
var bar = new RGraph.Bar('cvs', data)
.set('labels',['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
.grow();

Why?
Posted by Richard on 7th May 2014
Hi

I don't see anything wrong with it:

www.rgraph.net/fiddle/view/abar-chart-using-the-grow-effect

(I have taken two numbers out of the data array so that the labels line up)




Richard
Posted by Ruben on 7th May 2014
Hi,

I don't understand. I have an error from javascript. If I use .grow() say that function is undefined. If I use .draw() I can see the chart.

I try this:

RGraph.Effects.Bar.Grow(bar);

Is function.

Thanks
Posted by Richard on 7th May 2014
Hi

This is the old way of calling animations:

RGraph.Effects.Bar.Grow(bar);


And the new way is this:

var data = [4,8,6,3,1,2,5];
var bar = new RGraph.Bar('cvs', data)
   .set('labels',['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
   .grow();

So you're probably mixing the new way with older libraries - or vice-versa. So update to the stable libraries from the website and use the new method.



Richard
Posted by Ruben on 7th May 2014
Hi,

that is the problem.

It's solved.

I have to change other effects, for example:

"RGraph.Effects.jQuery.Reveal(line);"

Thanks.
Posted by Richard on 7th May 2014
Hi

If that was a question - then yes. When you create the bar object, and the effects file has been included in the page, the generic effects are "decorated" on to the object. So you can do this:


var data = [4,8,6,3,1,2,5];
var bar = new RGraph.Bar('cvs', data)
    .set('labels',['Monday','Tuesday','Wednesday','Thursday','Friday','Saturday','Sunday'])
    .reveal();

eg

www.rgraph.net/demos/effects-generic-reveal.html


Richard
Posted by Ruben on 7th May 2014
Yes

I see. I am using ".trace2();"

Thanks.

Add a reply

 




« Back to message list
RGraph on social media