Gradient Background on the canvas tag

Share RGraph:   Share or Like RGraph on Facebook!

« 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 Pete Benes on 24th February 2014
Hi,

is there a way to set the background to appear as a gradient? Something like this :

media02.hongkiat.com/online_chart_generators/chartlet.jpg


Thanks
Posted by Richard on 24th February 2014
Hi there,

The easiest way would be to use CSS on the canvas tag:


canvas#cvs {
     background-color: rgba(248,248,248, 0.5);
     background: -webkit-gradient(linear, left top, left bottom, from(#eee), to(white));
     background: -moz-linear-gradient(top, #eee, white);
     background-image: linear-gradient( 0deg, white, #eee);
     filter: progid:DXImageTransform.Microsoft.gradient(startColorstr='#eeeeee', endColorstr='#ffffff');
}


Richard

Add a reply




« Back to message list