How to get text with a blurry drop shadow?

Share RGraph:   To help my Google visibility (it can't get much worse!), if you like and use RGraph I'd appreciate it if you could link to me

« 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 Mikey Wetzel on 2nd September 2016
I'm using RGraph.Drawing.Text to draw my chart's title, and want the text to have a drop shadow. This isn't in the docs, and a web search came up empty handed. I tried using shadowBlur, shadowOffestX, etc., to no avail.

I thought of maybe using HTML5 to write the title, but I'm still learning whether that is possible.
Posted by Mikey Wetzel on 3rd September 2016
While I would prefer the cleanliness for text shadows using nothing but RGraph code, for those looking for a workaround, I did manage to achieve the effect using CSS text-shadow and absolute position:

     <div style="position:relative;">

       <canvas id="canvasChart" width="600" height="250" style="background: url('./ChartBackground.png')">[No canvas support]</canvas>
      
       <p style="position:absolute; top: -20px; text-align: center; width:600px; text-shadow: 0px 3px 4px black;">
         My Chart Title
       </p>

     </div>
Posted by Richard on 3rd September 2016
Hi there,

Are you using DOM text (it's the default so if you haven't set the textAccessible property you probably are)?

If you are then you can do this to add a CSS text shadow to the text:

www.rgraph.net/tests/drawing.text-shadow.html




Richard

Add a reply




« Back to message list