Text inside the chart as variable


« 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 Jen on 8th August 2014
I'm trying to get the text inside my pie graph to be a variable,

Right now its set at 23.

For example I would like it to display the variable 'month.'


var today = new Date();
var month= today.getMonth();

             var text = new RGraph.Drawing.Text('cvs', donut.centerx, donut.centery, '23')
                 .set('size', 25)
                 .set('halign', 'center')
                 .set('valign', 'center')
                 text.set('colors', ['gray'])
                 .draw();


Thanks so much!
Posted by Richard on 8th August 2014
So just substitute the '23' with the variable:

var text = new RGraph.Drawing.Text('cvs', donut.centerx, donut.centery, String(month) )





Richard
Posted by Jen on 8th August 2014
I didn't add the 'String' part...

Sorry I am new at this

and Thank you so much!!

Add a reply

 




« Back to message list
RGraph on social media