-1

I have a function that draws circles on my svg element:

function drawCircle( pElem, pX, pY)
{
    pElem.circle( 7 ).fill( '#00FF00' ).move( pX, pY );
} //drawCircle

But I want to add a black stroke to the drawn element like this:

function drawCircle( pElem, pX, pY)
{
    pElem.circle( 7 ).fill( '#00FF00' ).move( pX, pY ).style.stroke = 'black'; //tried this but it didn't work

} //drawCircle

How can I do this? (Note: I'm using svg.js library)

faintsignal
  • 1,828
  • 3
  • 22
  • 30
K_dev
  • 337
  • 2
  • 9

1 Answers1

0

The API doc mentions a total of five possibilities:

.stroke('#000') // seems hex notation is expected
.attr('stroke', 'black')
.attr({stroke: 'black'})
.style('stroke', 'black')
.style({stroke: 'black'})
ccprog
  • 20,308
  • 4
  • 27
  • 44
  • Thanks a lot, it is exactly that what i was searching for – K_dev Nov 15 '18 at 17:31
  • I searched for it, in google and in the documentation but i dind't found it so thats why o posted here (im not english fluent so that makes harder to me to find). I dont intend to put questions to be downvoted. – K_dev Nov 16 '18 at 17:23