Gradient Background on the canvas tag


« 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
www.rgraph.net
If RGraph has helped you - please share the website - thanks!

Add a reply

 




« Back to message list
RGraph on social media