ashiguruma / patternomaly

Easily generate patterns for use in data graphics
MIT License
524 stars 37 forks source link

Resizeable patterns #18

Closed viorell91 closed 6 years ago

viorell91 commented 6 years ago

Hi guys,

I have a small bar chart whose bars are filled with diagonal patterns.

grafik

Since the chart is small, the patterns look pretty ugly. Do you have any idea how to decrease the size of the pattern? I would like the diagonal lines to be more frequent and thinner.

JoeKuhns commented 6 years ago

when you do... pattern.draw('name', 'pattern color', 'background color', pattern size),

The first variable is pattern name, the second is pattern color, the third, is background color, and the fourth is pattern size. so put a number in the fourth spot and you are all set, I believe the default is 20.

viorell91 commented 6 years ago

Oh, I missed the rest of the function parameters. Very nice. Thanks for quick answer.

tommypeterz commented 4 years ago

I haven't seen those last two parameters mentioned anywhere else, and aren't #2 and #3 in reverse order...?

function draw() { var shapeType = arguments.length > 0 && arguments[0] !== undefined ? arguments[0] : 'square'; var backgroundColor = arguments[1]; var patternColor = arguments[2]; var size = arguments[3];